mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xu Yilun <yilun.xu@linux.intel.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: linux-fpga@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Luwei Kang <luwei.kang@intel.com>,
	Moritz Fischer <mdf@kernel.org>, Tom Rix <trix@redhat.com>,
	Wu Hao <hao.wu@intel.com>, Xu Yilun <yilun.xu@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Kunwu Chan <chentao@kylinos.cn>
Subject: Re: [PATCH] fpga: dfl: fme: Return directly after a failed devm_kasprintf() call in fme_perf_pmu_register()
Date: Tue, 30 Jan 2024 18:27:25 +0800	[thread overview]
Message-ID: <ZbjPDX1y2I9Heanq@yilunxu-OptiPlex-7050> (raw)
In-Reply-To: <ZbjJYMlDifIv0WId@yilunxu-OptiPlex-7050>

On Tue, Jan 30, 2024 at 06:03:12PM +0800, Xu Yilun wrote:
> On Sat, Jan 27, 2024 at 03:55:19PM +0100, Markus Elfring wrote:
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Sat, 27 Jan 2024 15:43:42 +0100

Sorry, something to fix.

Please shorten your shortlog to less than 75 chars.
Please refer to Documentation/process/submitting-patches.rst

> > 
> > The result from a call of the function “devm_kasprintf” was passed to
> > a subsequent function call without checking for a null pointer before
> > (according to a memory allocation failure).
> > This issue was detected by using the Coccinelle software.
> > 
> > Thus return directly after a failed devm_kasprintf() call.
> > 
> > Fixes: 724142f8c42a7 ("fpga: dfl: fme: add performance reporting support")

One more char of sha.

Please use checkpatch to verify.

Thanks,
Yilun

> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> 
> Acked-by: Xu Yilun <yilun.xu@intel.com>
> 
> > ---
> >  drivers/fpga/dfl-fme-perf.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/fpga/dfl-fme-perf.c b/drivers/fpga/dfl-fme-perf.c
> > index 7422d2bc6f37..db56d52411ef 100644
> > --- a/drivers/fpga/dfl-fme-perf.c
> > +++ b/drivers/fpga/dfl-fme-perf.c
> > @@ -925,6 +925,8 @@ static int fme_perf_pmu_register(struct platform_device *pdev,
> >  				PERF_PMU_CAP_NO_EXCLUDE;
> > 
> >  	name = devm_kasprintf(priv->dev, GFP_KERNEL, "dfl_fme%d", pdev->id);
> > +	if (!name)
> > +		return -ENOMEM;
> > 
> >  	ret = perf_pmu_register(pmu, name, -1);
> >  	if (ret)
> > --
> > 2.43.0
> > 
> > 
> 

  reply	other threads:[~2024-01-30 10:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-27 14:55 Markus Elfring
2024-01-30 10:03 ` Xu Yilun
2024-01-30 10:27   ` Xu Yilun [this message]
2024-01-30 10:48     ` Markus Elfring
2024-01-30 13:59       ` Xu Yilun
2024-01-31  7:42         ` Markus Elfring
2024-01-30 14:11     ` [PATCH] " Greg Kroah-Hartman
2024-01-30 15:49 ` Dan Carpenter
2024-01-30 17:09   ` Markus Elfring
2024-01-30 17:13     ` Greg Kroah-Hartman
2024-01-31  5:43     ` Dan Carpenter
2024-01-31  7:51       ` Markus Elfring
2024-02-02  7:57   ` Markus Elfring

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=ZbjPDX1y2I9Heanq@yilunxu-OptiPlex-7050 \
    --to=yilun.xu@linux.intel.com \
    --cc=Markus.Elfring@web.de \
    --cc=chentao@kylinos.cn \
    --cc=gregkh@linuxfoundation.org \
    --cc=hao.wu@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luwei.kang@intel.com \
    --cc=mdf@kernel.org \
    --cc=trix@redhat.com \
    --cc=yilun.xu@intel.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®