From: Guixin Liu <kanie@linux.alibaba.com>
To: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com,
shivasharan.srikanteshwara@broadcom.com, jejb@linux.ibm.com,
martin.petersen@oracle.com
Cc: megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi: megaraid_sas: remove unnecessary kfree
Date: Mon, 8 Aug 2022 10:37:46 +0800 [thread overview]
Message-ID: <76be7fa8-2c68-331a-db7c-ed346184a08a@linux.alibaba.com> (raw)
In-Reply-To: <1659424740-46918-1-git-send-email-kanie@linux.alibaba.com>
Hi,
Gentle ping.
在 2022/8/2 15:19, Guixin Liu 写道:
> When alloc ctrl mem fail, the reply_map will be free in
> megasas_free_ctrl_mem(), no need to free in megasas_alloc_ctrl_mem().
>
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
> ---
> drivers/scsi/megaraid/megaraid_sas_base.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index a3e117a..f6c37a9 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -7153,22 +7153,18 @@ static int megasas_alloc_ctrl_mem(struct megasas_instance *instance)
> switch (instance->adapter_type) {
> case MFI_SERIES:
> if (megasas_alloc_mfi_ctrl_mem(instance))
> - goto fail;
> + return -ENOMEM;
> break;
> case AERO_SERIES:
> case VENTURA_SERIES:
> case THUNDERBOLT_SERIES:
> case INVADER_SERIES:
> if (megasas_alloc_fusion_context(instance))
> - goto fail;
> + return -ENOMEM;
> break;
> }
>
> return 0;
> - fail:
> - kfree(instance->reply_map);
> - instance->reply_map = NULL;
> - return -ENOMEM;
> }
>
> /*
next prev parent reply other threads:[~2022-08-08 2:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-02 7:19 [PATCH] scsi: megaraid_sas: remove unnecessary kfree Guixin Liu
2022-08-08 2:37 ` Guixin Liu [this message]
2022-08-08 10:40 ` Sumit Saxena
2022-08-12 2:13 ` 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=76be7fa8-2c68-331a-db7c-ed346184a08a@linux.alibaba.com \
--to=kanie@linux.alibaba.com \
--cc=jejb@linux.ibm.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=megaraidlinux.pdl@broadcom.com \
--cc=shivasharan.srikanteshwara@broadcom.com \
--cc=sumit.saxena@broadcom.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