summaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2019-07-26 16:27:36 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-06 10:19:32 +0200
commit2270c887deeaf4181d87a348abb3d9c05c48d3f2 (patch)
tree6cec0216f6dae34fe02a0abed9d44188c66918e6 /drivers/isdn
parentbbed0360e4ac4eabc882999f4836df6cb0d0c13c (diff)
downloadlinux-stable-2270c887deeaf4181d87a348abb3d9c05c48d3f2.tar.gz
linux-stable-2270c887deeaf4181d87a348abb3d9c05c48d3f2.tar.bz2
linux-stable-2270c887deeaf4181d87a348abb3d9c05c48d3f2.zip
isdn: mISDN: hfcsusb: Fix possible null-pointer dereferences in start_isoc_chain()
[ Upstream commit a0d57a552b836206ad7705a1060e6e1ce5a38203 ] In start_isoc_chain(), usb_alloc_urb() on line 1392 may fail and return NULL. At this time, fifo->iso[i].urb is assigned to NULL. Then, fifo->iso[i].urb is used at some places, such as: LINE 1405: fill_isoc_urb(fifo->iso[i].urb, ...) urb->number_of_packets = num_packets; urb->transfer_flags = URB_ISO_ASAP; urb->actual_length = 0; urb->interval = interval; LINE 1416: fifo->iso[i].urb->... LINE 1419: fifo->iso[i].urb->... Thus, possible null-pointer dereferences may occur. To fix these bugs, "continue" is added to avoid using fifo->iso[i].urb when it is NULL. These bugs are found by a static analysis tool STCheck written by us. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/hardware/mISDN/hfcsusb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
index c60c7998af17..6f19530ba2a9 100644
--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
+++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
@@ -1402,6 +1402,7 @@ start_isoc_chain(struct usb_fifo *fifo, int num_packets_per_urb,
printk(KERN_DEBUG
"%s: %s: alloc urb for fifo %i failed",
hw->name, __func__, fifo->fifonum);
+ continue;
}
fifo->iso[i].owner_fifo = (struct usb_fifo *) fifo;
fifo->iso[i].indx = i;