devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of/unittest: Missing unlocks on error
@ 2017-05-03 19:49 Dan Carpenter
  2017-05-04  0:05 ` Frank Rowand
  2017-05-04 16:09 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-05-03 19:49 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand; +Cc: Frank Rowand, devicetree, kernel-janitors

Static checkers complain that we should unlock before returning.  Which
is true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 12597ff8cfb0..425338d6286d 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -2210,14 +2210,14 @@ static __init void of_unittest_overlay_high_level(void)
 				unittest(0,
 					 "duplicate property '%s' in overlay_base node __symbols__",
 					 prop->name);
-				return;
+				goto err_unlock;
 			}
 			ret = __of_add_property_sysfs(of_symbols, prop);
 			if (ret) {
 				unittest(0,
 					 "unable to add property '%s' in overlay_base node __symbols__ to sysfs",
 					 prop->name);
-				return;
+				goto err_unlock;
 			}
 		}
 	}
@@ -2232,6 +2232,10 @@ static __init void of_unittest_overlay_high_level(void)
 
 	unittest(overlay_data_add(2),
 		 "Adding overlay 'overlay_bad_phandle' failed\n");
+	return;
+
+err_unlock:
+	mutex_unlock(&of_mutex);
 }
 
 #else

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] of/unittest: Missing unlocks on error
  2017-05-03 19:49 [PATCH] of/unittest: Missing unlocks on error Dan Carpenter
@ 2017-05-04  0:05 ` Frank Rowand
  2017-05-04 16:09 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Rowand @ 2017-05-04  0:05 UTC (permalink / raw)
  To: Dan Carpenter, Rob Herring
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

On 05/03/17 12:49, Dan Carpenter wrote:
> Static checkers complain that we should unlock before returning.  Which
> is true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> 
> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> index 12597ff8cfb0..425338d6286d 100644
> --- a/drivers/of/unittest.c
> +++ b/drivers/of/unittest.c
> @@ -2210,14 +2210,14 @@ static __init void of_unittest_overlay_high_level(void)
>  				unittest(0,
>  					 "duplicate property '%s' in overlay_base node __symbols__",
>  					 prop->name);
> -				return;
> +				goto err_unlock;
>  			}
>  			ret = __of_add_property_sysfs(of_symbols, prop);
>  			if (ret) {
>  				unittest(0,
>  					 "unable to add property '%s' in overlay_base node __symbols__ to sysfs",
>  					 prop->name);
> -				return;
> +				goto err_unlock;
>  			}
>  		}
>  	}
> @@ -2232,6 +2232,10 @@ static __init void of_unittest_overlay_high_level(void)
>  
>  	unittest(overlay_data_add(2),
>  		 "Adding overlay 'overlay_bad_phandle' failed\n");
> +	return;
> +
> +err_unlock:
> +	mutex_unlock(&of_mutex);
>  }
>  
>  #else
> 

Thanks Dan.

Reviewed-by: Frank Rowand <frank.rowand-7U/KSKJipcs@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] of/unittest: Missing unlocks on error
  2017-05-03 19:49 [PATCH] of/unittest: Missing unlocks on error Dan Carpenter
  2017-05-04  0:05 ` Frank Rowand
@ 2017-05-04 16:09 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2017-05-04 16:09 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Frank Rowand, Frank Rowand, devicetree@vger.kernel.org,
	kernel-janitors

On Wed, May 3, 2017 at 2:49 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Static checkers complain that we should unlock before returning.  Which
> is true.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.

Rob

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-04 16:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-03 19:49 [PATCH] of/unittest: Missing unlocks on error Dan Carpenter
2017-05-04  0:05 ` Frank Rowand
2017-05-04 16:09 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).