Skip to content

Commit

Permalink
drm/drm_stub: Remove unnecessary null check before kfree.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sachin Kamat authored and Dave Airlie committed Nov 20, 2012
1 parent 8c5eaca commit 66141d3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 66141d3

Please sign in to comment.