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:
Peter Senna Tschudin 2016-01-15 18:41:32 +01:00 committed by Greg Kroah-Hartman
parent 662bfe7b53
commit 8a102fd6c9

View File

@ -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)