summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/serial.c')
-rw-r--r--drivers/usb/gadget/serial.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 2af3f785d5a1..f1762ed6db63 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -2312,9 +2312,8 @@ static struct gs_buf *gs_buf_alloc(unsigned int size, int kmalloc_flags)
*/
void gs_buf_free(struct gs_buf *gb)
{
- if (gb != NULL) {
- if (gb->buf_buf != NULL)
- kfree(gb->buf_buf);
+ if (gb) {
+ kfree(gb->buf_buf);
kfree(gb);
}
}
OpenPOWER on IntegriCloud