Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1442739
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/3] drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" |
| Date | 2016-07-13 20:10 +0200 |
| Message-ID | <rUwLE-6Du-21@gated-at.bofh.it> (permalink) |
| References | (13 earlier) <mSsDN-4wa-61@gated-at.bofh.it> <mSsDN-4wa-63@gated-at.bofh.it> <mSsDN-4wa-65@gated-at.bofh.it> <mSsDN-4wa-33@gated-at.bofh.it> <rUwBY-6kl-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 13 Jul 2016 18:54:11 +0200
The kfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c
index 0baaaaa..6e76797 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c
@@ -1430,7 +1430,7 @@ struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi)
void msm_hdmi_hdcp_destroy(struct hdmi *hdmi)
{
- if (hdmi && hdmi->hdcp_ctrl) {
+ if (hdmi) {
kfree(hdmi->hdcp_ctrl);
hdmi->hdcp_ctrl = NULL;
}
--
2.9.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] drm/msm: Deletion of a few unnecessary checks SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-13 20:00 +0200 [PATCH 3/3] drm/msm: Delete an unnecessary check before drm_gem_object_unreference() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-13 20:10 +0200 [PATCH 1/3] drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-13 20:10 +0200 [PATCH 2/3] drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-13 20:10 +0200 Re: [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks Rob Clark <robdclark@gmail.com> - 2016-07-15 04:10 +0200
csiph-web