summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/sisusbvga/sisusb.c
diff options
context:
space:
mode:
authorPeter Senna Tschudin <peter.senna@gmail.com>2016-01-15 18:41:32 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-24 21:04:54 -0800
commit8a102fd6c99a26a0aa74e3d4bed4092b3c791361 (patch)
treea762786853420a97987e8f5bfbdba364a10e8317 /drivers/usb/misc/sisusbvga/sisusb.c
parent662bfe7b537f0c199024b252d451727a76449233 (diff)
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>
Diffstat (limited to 'drivers/usb/misc/sisusbvga/sisusb.c')
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index 40f360ab406d..bea6d88f769a 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -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)