mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Jitendra Bhivare <jitendra.bhivare@broadcom.com>,
	Ketan Mukadam <ketan.mukadam@broadcom.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: stable@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scsi: be2iscsi: fix a memory leak in beiscsi_boot_get_sinfo()
Date: Sat, 20 Dec 2025 17:09:50 +0100	[thread overview]
Message-ID: <53c5a56b-81fc-44af-bade-21aea79682f8@web.de> (raw)
In-Reply-To: <20251213083643.301240-1-lihaoxiang@isrc.iscas.ac.cn>

> If nonemb_cmd->va fails to be allocated, call free_mcc_wrb()
> to restore the impact caused by alloc_mcc_wrb().

     avoid?


…
> +++ b/drivers/scsi/be2iscsi/be_mgmt.c
> @@ -1025,6 +1025,7 @@ unsigned int beiscsi_boot_get_sinfo(struct beiscsi_hba *phba)
>  					      &nonemb_cmd->dma,
>  					      GFP_KERNEL);
>  	if (!nonemb_cmd->va) {
> +		free_mcc_wrb(ctrl, tag);
>  		mutex_unlock(&ctrl->mbox_lock);
>  		return 0;
>  	}

I suggest to avoid also repeated mutex_unlock() calls in this function implementation.

Regards,
Markus

  reply	other threads:[~2025-12-20 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-13  8:36 Haoxiang Li
2025-12-20 16:09 ` Markus Elfring [this message]
2026-01-24  3:53 ` 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=53c5a56b-81fc-44af-bade-21aea79682f8@web.de \
    --to=markus.elfring@web.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hare@suse.com \
    --cc=jitendra.bhivare@broadcom.com \
    --cc=ketan.mukadam@broadcom.com \
    --cc=lihaoxiang@isrc.iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /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®