From: kbuild test robot <lkp@intel.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: kbuild-all@01.org, linux-media@vger.kernel.org,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Subject: [PATCH] uvcvideo: fix ifnullfree.cocci warnings
Date: Sun, 30 Jul 2017 14:31:52 +0800 [thread overview]
Message-ID: <20170730063151.GA22846@lkp-nex05> (raw)
In-Reply-To: <1501245205-15802-6-git-send-email-g.liakhovetski@gmx.de>
drivers/media/usb/uvc/uvc_ctrl.c:1327:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
NULL check before some freeing functions is not needed.
Based on checkpatch warning
"kfree(NULL) is safe this check is probably not required"
and kfreeaddr.cocci by Julia Lawall.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
Fixes: c698cbbd35da ("uvcvideo: send a control event when a Control Change interrupt arrives")
CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
uvc_ctrl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -1322,9 +1322,8 @@ void uvc_ctrl_status_event(struct uvc_de
return;
spin_lock(&w->lock);
- if (w->data)
/* A previous event work hasn't run yet, we lose 1 event */
- kfree(w->data);
+ kfree(w->data);
w->data = kmalloc(len, GFP_ATOMIC);
if (w->data) {
next prev parent reply other threads:[~2017-07-30 6:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 12:33 [PATCH 0/6 v5] uvcvideo: metadata nodes and controls Guennadi Liakhovetski
2017-07-28 12:33 ` [PATCH 1/6 v5] UVC: fix .queue_setup() to check the number of planes Guennadi Liakhovetski
2017-07-31 13:57 ` Laurent Pinchart
2017-07-31 13:58 ` Laurent Pinchart
2017-07-28 12:33 ` [PATCH 2/6 v5] V4L: Add a UVC Metadata format Guennadi Liakhovetski
2017-07-28 12:46 ` Hans Verkuil
2017-10-30 12:10 ` Hans Verkuil
2017-11-06 14:53 ` Guennadi Liakhovetski
2017-11-07 11:14 ` Laurent Pinchart
2017-11-08 10:43 ` Guennadi Liakhovetski
2017-11-09 5:42 ` Laurent Pinchart
2017-11-09 7:37 ` Guennadi Liakhovetski
2017-10-17 12:51 ` Laurent Pinchart
2017-07-28 12:33 ` [PATCH 3/6 v5] uvcvideo: convert from using an atomic variable to a reference count Guennadi Liakhovetski
2017-07-31 14:39 ` Laurent Pinchart
2017-07-28 12:33 ` [PATCH 4/6 v5] uvcvideo: add a metadata device node Guennadi Liakhovetski
2017-07-28 12:50 ` Hans Verkuil
2017-07-28 13:03 ` Guennadi Liakhovetski
2017-10-18 7:32 ` Guennadi Liakhovetski
2017-10-18 14:00 ` Laurent Pinchart
2017-10-18 7:35 ` [PATCH 4/6 v6] " Guennadi Liakhovetski
2017-07-28 12:33 ` [PATCH 5/6 v5] uvcvideo: send a control event when a Control Change interrupt arrives Guennadi Liakhovetski
2017-07-30 6:31 ` kbuild test robot
2017-07-30 6:31 ` kbuild test robot [this message]
2017-08-08 2:18 ` [lkp-robot] [uvcvideo] c698cbbd35: Failed to query (GET_INFO) UVC control 11 on unit 1: -32 (exp. 1) kernel test robot
2017-10-17 18:18 ` Laurent Pinchart
2017-10-17 18:17 ` [PATCH 5/6 v5] uvcvideo: send a control event when a Control Change interrupt arrives Laurent Pinchart
2017-07-28 12:33 ` [PATCH 6/6 v5] uvcvideo: handle control pipe protocol STALLs Guennadi Liakhovetski
2017-10-17 18:34 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170730063151.GA22846@lkp-nex05 \
--to=lkp@intel.com \
--cc=g.liakhovetski@gmx.de \
--cc=guennadi.liakhovetski@intel.com \
--cc=hverkuil@xs4all.nl \
--cc=kbuild-all@01.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox