Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1526421

Re: [PATCH] stm class: Add a missing call to put_device

From Alexander Shishkin <alexander.shishkin@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] stm class: Add a missing call to put_device
Date 2016-11-21 08:40 +0100
Message-ID <sFRmN-6Ce-7@gated-at.bofh.it> (permalink)
References <sFiyK-5C-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Quentin Lambert <lambert.quentin@gmail.com> writes:

> Most error branches following the call to class_find_device contain
> a call to put_device. This patch add calls to put_device where
> they are missing.
>
> This issue was found with Hector.
>
> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
>
> ---
>  drivers/hwtracing/stm/core.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/hwtracing/stm/core.c
> +++ b/drivers/hwtracing/stm/core.c
> @@ -368,8 +368,10 @@ static int stm_char_open(struct inode *i
>  		return -ENODEV;
>  
>  	stmf = kzalloc(sizeof(*stmf), GFP_KERNEL);
> -	if (!stmf)
> +	if (!stmf) {
> +		put_device(dev);
>  		return -ENOMEM;
> +	}

There is a goto label at the bottom of this function which is supposed
 to deal with this. See the fix that we already have [1] for this issue.

[1] https://git.kernel.org/cgit/linux/kernel/git/ash/stm.git/commit/?h=stm-for-greg-20161118&id=a0ebf519b8a2666438d999c62995618c710573e5

Regards,
--
alex

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] stm class: Add a missing call to put_device Quentin Lambert <lambert.quentin@gmail.com> - 2016-11-19 19:30 +0100
  Re: [PATCH] stm class: Add a missing call to put_device Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-11-21 08:40 +0100
    Re: [PATCH] stm class: Add a missing call to put_device Quentin Lambert <lambert.quentin@gmail.com> - 2016-11-21 09:10 +0100

csiph-web