From: Heiner Kallweit Date: Wed, 1 Feb 2017 07:05:22 +0000 (+0100) Subject: reset: core: fix reset_control_put X-Git-Tag: v4.9.144~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4b89ecc29514792c3e37ec509fba9e283dbd5e7;p=thirdparty%2Fkernel%2Fstable.git reset: core: fix reset_control_put commit 4891486fb2c80eaf3bb0f9eb065d15ecd357702f upstream. Commit "reset: make optional functions really optional" missed to adjust one check in reset_control_put, causing a NULL pointer access for optional resets. Fixes: bb475230b8e5 "reset: make optional functions really optional" Signed-off-by: Heiner Kallweit Signed-off-by: Philipp Zabel Cc: Dinh Nguyen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/reset/core.c b/drivers/reset/core.c index 75821417b799f..f62f57ebc45a0 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -358,7 +358,7 @@ EXPORT_SYMBOL_GPL(__of_reset_control_get); void reset_control_put(struct reset_control *rstc) { - if (IS_ERR(rstc)) + if (IS_ERR_OR_NULL(rstc)) return; mutex_lock(&reset_list_mutex);