kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Dan Carpenter <dan.carpenter@oracle.com>
Cc: Arend van Spriel <aspriel@gmail.com>,
	Matthias Brugger <mbrugger@suse.com>,
	Franky Lin <franky.lin@broadcom.com>,
	Hante Meuleman <hante.meuleman@broadcom.com>,
	Chi-hsien Lin <chi-hsien.lin@infineon.com>,
	Wright Feng <wright.feng@infineon.com>,
	Chung-hsien Hsu <chung-hsien.hsu@infineon.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	Hans deGoede <hdegoede@redhat.com>,
	linux-wireless@vger.kernel.org,
	brcm80211-dev-list.pdl@broadcom.com,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] brcmfmac: fix a loop exit condition
Date: Fri, 23 Apr 2021 14:54:03 +0200	[thread overview]
Message-ID: <17adb27af76820813c035874fad7e468681bfe04.camel@sipsolutions.net> (raw)
In-Reply-To: <bda7ae6b-00f9-ae0e-66d3-413049bc543d@wanadoo.fr>

On Fri, 2021-04-23 at 14:20 +0200, Christophe JAILLET wrote:
> 
> > > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> > > > @@ -34,7 +34,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
> > > >   		len = strlen(tmp) + 1;
> > > >   		board_type = devm_kzalloc(dev, len, GFP_KERNEL);
> > > >   		strscpy(board_type, tmp, len);
> > > > -		for (i = 0; i < board_type[i]; i++) {
> > > > +		for (i = 0; i < len; i++) {
> > > >   			if (board_type[i] == '/')
> > > >   				board_type[i] = '-';
> > > >   		}
> > > 
> > > It should probably just use strreplace() though :)
> > 
> > Good point.  I'll send a v2.
> > 
> 
> and the 2 lines above look like a devm_kstrdup.
> 
> The (unlikely) malloc failure test is also missing.

How many issues can you have in 6 lines of code ;-)

johannes


  reply	other threads:[~2021-04-23 12:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 11:46 [PATCH] brcmfmac: fix a loop exit condition Dan Carpenter
2021-04-23 11:56 ` Matthias Brugger
2021-04-23 11:59 ` Johannes Berg
2021-04-23 12:11   ` Dan Carpenter
2021-04-23 12:20     ` Christophe JAILLET
2021-04-23 12:54       ` Johannes Berg [this message]
2021-05-08 11:02       ` Dan Carpenter
2021-06-15 10:26 ` Kalle Valo
     [not found] ` <20210615102656.DBB04C43143@smtp.codeaurora.org>
2021-06-15 12:52   ` Dan Carpenter
2021-06-15 13:45     ` Kalle Valo

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=17adb27af76820813c035874fad7e468681bfe04.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=aspriel@gmail.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=chi-hsien.lin@infineon.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=chung-hsien.hsu@infineon.com \
    --cc=dan.carpenter@oracle.com \
    --cc=franky.lin@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=hdegoede@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mbrugger@suse.com \
    --cc=wright.feng@infineon.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;
as well as URLs for NNTP newsgroup(s).