From: kbuild test robot <fengguang.wu@intel.com>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
Colin Ian King <colin.king@canonical.com>,
Satendra Singh Thakur <satendra.t@samsung.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Daniel Scheller <d.scheller@gmx.net>,
Ingo Molnar <mingo@kernel.org>
Subject: [PATCH] dvb_frontend: fix ifnullfree.cocci warnings
Date: Mon, 27 Nov 2017 17:25:29 +0800 [thread overview]
Message-ID: <20171127092529.GA13087@lkp-ne02> (raw)
In-Reply-To: <201711271722.IU7xlxg2%fengguang.wu@intel.com>
drivers/media/dvb-core/dvb_frontend.c:154: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: b1cb7372fa82 ("dvb_frontend: don't use-after-free the frontend struct")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
dvb_frontend.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -150,8 +150,7 @@ static void __dvb_frontend_free(struct d
dvb_frontend_invoke_release(fe, fe->ops.release);
- if (fepriv)
- kfree(fepriv);
+ kfree(fepriv);
}
static void dvb_frontend_free(struct kref *ref)
prev parent reply other threads:[~2017-11-27 9:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 9:25 drivers/media/dvb-core/dvb_frontend.c:154: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 kbuild test robot
2017-11-27 9:25 ` kbuild test robot [this message]
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=20171127092529.GA13087@lkp-ne02 \
--to=fengguang.wu@intel.com \
--cc=colin.king@canonical.com \
--cc=d.scheller@gmx.net \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=mingo@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=satendra.t@samsung.com \
--cc=shuah@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