summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-11-19 10:44:59 +0100
committerDave Airlie <airlied@redhat.com>2012-11-20 06:41:00 +0100
commit66141d3d86f38701d657ef9ba973233bce53da79 (patch)
tree8e7ceaf10f6ab392baa2254461340870e21e9ea1
parentdrm/fb_helper: Fix potential NULL pointer dereference (diff)
downloadlinux-66141d3d86f38701d657ef9ba973233bce53da79.tar.xz
linux-66141d3d86f38701d657ef9ba973233bce53da79.zip
drm/drm_stub: Remove unnecessary null check before kfree.
kfree on a null argument is a no-op. Silences the following smatch warning: drivers/gpu/drm/drm_stub.c:496 drm_put_dev() info: redundant null check on dev->devname calling kfree() Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_stub.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 581e61d04057..6fcdd8ebcb3d 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -492,10 +492,7 @@ void drm_put_dev(struct drm_device *dev)
drm_put_minor(&dev->primary);
list_del(&dev->driver_item);
- if (dev->devname) {
- kfree(dev->devname);
- dev->devname = NULL;
- }
+ kfree(dev->devname);
kfree(dev);
}
EXPORT_SYMBOL(drm_put_dev);