From: Bart Van Assche <bvanassche@acm.org>
To: Yu Kuai <yukuai1@huaweicloud.com>,
jejb@linux.ibm.com, martin.petersen@oracle.com, hare@suse.de,
axboe@kernel.dk, sconnor@purestorage.com,
michael.christie@oracle.com, brian@purestorage.com,
yukuai3@huawei.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
yi.zhang@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH -next] scsi: scsi_dh_alua: fix memleak for 'qdata' in alua_activate()
Date: Wed, 15 Mar 2023 09:51:23 -0700 [thread overview]
Message-ID: <92a53663-0359-5e87-2561-340a8719521c@acm.org> (raw)
In-Reply-To: <20230315062154.668812-1-yukuai1@huaweicloud.com>
On 3/14/23 23:21, Yu Kuai wrote:
> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
> index 362fa631f39b..a226dc1b65d7 100644
> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
> @@ -1145,10 +1145,12 @@ static int alua_activate(struct scsi_device *sdev,
> rcu_read_unlock();
> mutex_unlock(&h->init_mutex);
>
> - if (alua_rtpg_queue(pg, sdev, qdata, true))
> + if (alua_rtpg_queue(pg, sdev, qdata, true)) {
> fn = NULL;
> - else
> + } else {
> + kfree(qdata);
> err = SCSI_DH_DEV_OFFLINED;
> + }
> kref_put(&pg->kref, release_port_group);
> out:
> if (fn)
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
next prev parent reply other threads:[~2023-03-15 16:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 6:21 Yu Kuai
2023-03-15 14:55 ` Benjamin Block
2023-03-15 16:51 ` Bart Van Assche [this message]
2023-03-17 4:04 ` Martin K. Petersen
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=92a53663-0359-5e87-2561-340a8719521c@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=brian@purestorage.com \
--cc=hare@suse.de \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=sconnor@purestorage.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@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
all inboxes | Powered by JetHome®