mirror of
https://github.com/torvalds/linux.git
synced 2024-11-05 11:32:04 +00:00
usb-misc: sisusbvga: Remove null test before calls to kfree()
This patch removes null test before calls to kfree() as kfree() can handle null pointers safely. Signed-off-by: Peter Senna Tschudin <peter.senna@collabora.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
662bfe7b53
commit
8a102fd6c9
@ -76,15 +76,11 @@ static void sisusb_free_buffers(struct sisusb_usb_data *sisusb)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUMOBUFS; i++) {
|
||||
if (sisusb->obuf[i]) {
|
||||
kfree(sisusb->obuf[i]);
|
||||
sisusb->obuf[i] = NULL;
|
||||
}
|
||||
}
|
||||
if (sisusb->ibuf) {
|
||||
kfree(sisusb->ibuf);
|
||||
sisusb->ibuf = NULL;
|
||||
kfree(sisusb->obuf[i]);
|
||||
sisusb->obuf[i] = NULL;
|
||||
}
|
||||
kfree(sisusb->ibuf);
|
||||
sisusb->ibuf = NULL;
|
||||
}
|
||||
|
||||
static void sisusb_free_urbs(struct sisusb_usb_data *sisusb)
|
||||
|
Loading…
Reference in New Issue
Block a user