From: Markus Elfring <elfr...@users.sourceforge.net> 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 <elfr...@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkos...@suse.cz> Signed-off-by: Ping Cheng <pi...@wacom.com> [jason.gere...@wacom.com: backported from input-wacom 571a97e] Signed-off-by: Jason Gerecke <jason.gere...@wacom.com> --- 2.6.38/wacom_sys.c | 3 +-- 3.7/wacom_sys.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/2.6.38/wacom_sys.c b/2.6.38/wacom_sys.c index 69aa7d5..7902e21 100644 --- a/2.6.38/wacom_sys.c +++ b/2.6.38/wacom_sys.c @@ -1408,8 +1408,7 @@ static void wacom_unregister_inputs(struct wacom *wacom) { if (wacom->wacom_wac.input) input_unregister_device(wacom->wacom_wac.input); - if (wacom->remote_dir) - kobject_put(wacom->remote_dir); + kobject_put(wacom->remote_dir); wacom->wacom_wac.input = NULL; wacom_destroy_leds(wacom); } diff --git a/3.7/wacom_sys.c b/3.7/wacom_sys.c index ed228b3..3047773 100644 --- a/3.7/wacom_sys.c +++ b/3.7/wacom_sys.c @@ -1402,8 +1402,7 @@ static void wacom_unregister_inputs(struct wacom *wacom) { if (wacom->wacom_wac.input) input_unregister_device(wacom->wacom_wac.input); - if (wacom->remote_dir) - kobject_put(wacom->remote_dir); + kobject_put(wacom->remote_dir); wacom->wacom_wac.input = NULL; wacom_destroy_leds(wacom); } -- 2.7.1 ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel