zr364xx.c: vfree does its own NULL check
PATCH 1/1 zr364xx.c: vfree does its own NULL check
vfree() does it's own NULL checking, no need for explicit check before calling it.
Signed-off-by Figo.zhang <[email protected]>
---
drivers/media/video/zr364xx.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/media/video/zr364xx.c +4 -2
@@ -882,9 +882,11 @@ static void zr364xx_disconnect(struct usb_interface *intf)video_unregister_device (cam->vdev); cam->vdev =NULL ;kfree (cam->buffer); -if (cam->framebuf) -vfree (cam->framebuf); + cam->buffer =NULL ; +vfree (cam->framebuf); + cam->framebuf =NULL ;kfree (cam); + cam =NULL ; }
hi Mauro,
is it ok for this patch?
Best Regards,
Figo.zhang
Quoted 32 lines · Figo.zhang
vfree()does it's own NULL checking, no need for explicit check before calling it.Signed-off-by Figo.zhang <[email protected]>---
drivers/media/video/zr364xx.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)drivers/media/video/zr364xx.c +4
-2@@ -882,9 +882,11 @@ static void zr364xx_disconnect(struct usb_interface *intf)video_unregister_device (cam->vdev); cam->vdev =NULL ;kfree (cam->buffer); -if (cam->framebuf) -vfree (cam->framebuf); + cam->buffer =NULL ; +vfree (cam->framebuf); + cam->framebuf =NULL ;kfree (cam); + cam =NULL ; }