Re: [PATCH 09/17] s390/debug: Return directly if a null pointer was passed to debug_unregister()

From: walter harms
Date: Sat Sep 03 2016 - 08:43:11 EST




Am 03.09.2016 14:24, schrieb SF Markus Elfring:
> From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> Date: Thu, 1 Sep 2016 19:34:45 +0200
>
> Return directly at the beginning if a null pointer was passed for
> the input parameter of this function.
>
> Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> ---
> arch/s390/kernel/debug.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
> index c4a4641..d137150 100644
> --- a/arch/s390/kernel/debug.c
> +++ b/arch/s390/kernel/debug.c
> @@ -736,13 +736,10 @@ void
> debug_unregister(debug_info_t * id)
> {
> if (!id)
> - goto out;
> + return;
> mutex_lock(&debug_mutex);
> debug_info_put(id);
> mutex_unlock(&debug_mutex);
> -
> -out:
> - return;
> }
> EXPORT_SYMBOL(debug_unregister);
>

debug_info_put() will check for NULL, the whole check can be removed.

re,
wh