From: Jens Axboe <axboe@kernel.dk>
To: Mike Christie <mchristi@redhat.com>, Sun Ke <sunke32@huawei.com>,
josef@toxicpanda.com, linux-block@vger.kernel.org,
nbd@other.debian.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [v2] nbd:fix memory leak in nbd_get_socket()
Date: Tue, 19 Nov 2019 09:23:49 -0700 [thread overview]
Message-ID: <e7d5d08c-c8d6-cd22-ba0a-e53ab08ea5d8@kernel.dk> (raw)
In-Reply-To: <5DD416DB.1040302@redhat.com>
On 11/19/19 9:22 AM, Mike Christie wrote:
> On 11/19/2019 12:09 AM, Sun Ke wrote:
>> Before return NULL,put the sock first.
>>
>> Cc: stable@vger.kernel.org
>> Fixes: cf1b2326b734 ("nbd: verify socket is supported during setup")
>> Signed-off-by: Sun Ke <sunke32@huawei.com>
>> ---
>> v2: add cc:stable tag
>> ---
>> drivers/block/nbd.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
>> index a94ee45..19e7599 100644
>> --- a/drivers/block/nbd.c
>> +++ b/drivers/block/nbd.c
>> @@ -993,6 +993,7 @@ static struct socket *nbd_get_socket(struct nbd_device *nbd, unsigned long fd,
>> if (sock->ops->shutdown == sock_no_shutdown) {
>> dev_err(disk_to_dev(nbd->disk), "Unsupported socket: shutdown callout must be supported.\n");
>> *err = -EINVAL;
>> + sockfd_put(sock);
>> return NULL;
>> }
>>
>>
>
> Reviewed-by: Mike Christie <mchristi@redhat.com>
Thanks (both of you), applied for 5.4.
--
Jens Axboe
prev parent reply other threads:[~2019-11-19 16:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-19 6:09 [v2] nbd:fix memory leak in nbd_get_socket() Sun Ke
2019-11-19 16:13 ` Jens Axboe
2019-11-19 16:16 ` Josef Bacik
2019-11-19 16:22 ` Mike Christie
2019-11-19 16:23 ` Jens Axboe [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=e7d5d08c-c8d6-cd22-ba0a-e53ab08ea5d8@kernel.dk \
--to=axboe@kernel.dk \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchristi@redhat.com \
--cc=nbd@other.debian.org \
--cc=stable@vger.kernel.org \
--cc=sunke32@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