[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1452879694-21206-6-git-send-email-peter.senna@collabora.com>
Date: Fri, 15 Jan 2016 18:41:32 +0100
From: Peter Senna Tschudin <peter.senna@...labora.com>
To: thomas@...ischhofer.net, gregkh@...uxfoundation.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
joe@...ches.com, sergei.shtylyov@...entembedded.com
Cc: Peter Senna Tschudin <peter.senna@...il.com>,
Peter Senna Tschudin <peter.senna@...labora.com>
Subject: [PATCH V2 5/7] usb-misc: sisusbvga: Remove null test before calls to kfree()
From: Peter Senna Tschudin <peter.senna@...il.com>
This patch removes null test before calls to kfree() as kfree() can
handle null pointers safely.
Signed-off-by: Peter Senna Tschudin <peter.senna@...labora.com>
---
No changes from V1.
Tested by compilation only.
drivers/usb/misc/sisusbvga/sisusb.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index 40f360a..bea6d88 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)
--
2.5.0
Powered by blists - more mailing lists