Skip to content

Commit

Permalink
HID: wacom: Delete an unnecessary check before kobject_put()
Browse files Browse the repository at this point in the history
The kobject_put() 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>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Markus Elfring authored and Jiri Kosina committed Nov 19, 2015
1 parent 6f1da31 commit 27ba1d5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1353,8 +1353,7 @@ static void wacom_clean_inputs(struct wacom *wacom)
else
input_free_device(wacom->wacom_wac.pad_input);
}
if (wacom->remote_dir)
kobject_put(wacom->remote_dir);
kobject_put(wacom->remote_dir);
wacom->wacom_wac.pen_input = NULL;
wacom->wacom_wac.touch_input = NULL;
wacom->wacom_wac.pad_input = NULL;
Expand Down

0 comments on commit 27ba1d5

Please sign in to comment.