From: Andy Shevchenko Date: Fri, 2 Apr 2021 17:43:33 +0000 (+0300) Subject: ipmi_si: Drop redundant check before calling put_device() X-Git-Tag: v5.13-rc1~110^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25f314db2eff4902668a80f4bade321cdc8aa902;p=thirdparty%2Flinux.git ipmi_si: Drop redundant check before calling put_device() put_device() is NULL aware, drop redundant check before calling it. Signed-off-by: Andy Shevchenko Message-Id: <20210402174334.13466-10-andriy.shevchenko@linux.intel.com> Signed-off-by: Corey Minyard --- diff --git a/drivers/char/ipmi/ipmi_si_hotmod.c b/drivers/char/ipmi/ipmi_si_hotmod.c index 087f5eb1ebc0d..a07ef37c0e3f3 100644 --- a/drivers/char/ipmi/ipmi_si_hotmod.c +++ b/drivers/char/ipmi/ipmi_si_hotmod.c @@ -223,8 +223,7 @@ static int hotmod_handler(const char *val, const struct kernel_param *kp) if (strcmp(pdev->name, "hotmod-ipmi-si") == 0) platform_device_unregister(pdev); } - if (dev) - put_device(dev); + put_device(dev); } } rv = strlen(val);