Linux-HyperV List
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-input@vger.kernel.org, linux-hyperv@vger.kernel.org,
	kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, wei.liu@kernel.org
Subject: Re: [PATCH] HID: hyperv: fix possible memory leak in mousevsc_probe()
Date: Wed, 2 Nov 2022 14:34:06 +0100 (CET)	[thread overview]
Message-ID: <nycvar.YFH.7.76.2211021433580.29912@cbobk.fhfr.pm> (raw)
In-Reply-To: <20221028134043.1152629-1-yangyingliang@huawei.com>

On Fri, 28 Oct 2022, Yang Yingliang wrote:

> If hid_add_device() returns error, it should call hid_destroy_device()
> to free hid_dev which is allocated in hid_allocate_device().
> 
> Fixes: 74c4fb058083 ("HID: hv_mouse: Properly add the hid device")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/hid/hid-hyperv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
> index e0bc73124196..ab57b49a44ed 100644
> --- a/drivers/hid/hid-hyperv.c
> +++ b/drivers/hid/hid-hyperv.c
> @@ -499,7 +499,7 @@ static int mousevsc_probe(struct hv_device *device,
>  
>  	ret = hid_add_device(hid_dev);
>  	if (ret)
> -		goto probe_err1;
> +		goto probe_err2;
>  

Good catch, applied, thank you.

-- 
Jiri Kosina
SUSE Labs


      parent reply	other threads:[~2022-11-02 13:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 13:40 [PATCH] HID: hyperv: fix possible memory leak in mousevsc_probe() Yang Yingliang
2022-11-01 10:45 ` Wei Liu
2022-11-02 13:34 ` Jiri Kosina [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YFH.7.76.2211021433580.29912@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=wei.liu@kernel.org \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox