From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Christian Engelmayer <cengelma@gmx.at>
Cc: Mateusz Guzik <mguzik@redhat.com>,
devel@driverdev.osuosl.org, Larry.Finger@lwfinger.net,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723au: fix potential leak in update_bcn_wps_ie()
Date: Thu, 01 May 2014 23:46:57 +0200 [thread overview]
Message-ID: <wrfjtx99w4ry.fsf@ultrasam.lan.trained-monkey.org> (raw)
In-Reply-To: <20140501221631.291a9c49@spike> (Christian Engelmayer's message of "Thu, 1 May 2014 22:16:31 +0200")
Christian Engelmayer <cengelma@gmx.at> writes:
> On Thu, 1 May 2014 14:22:17 +0200, Mateusz Guzik <mguzik@redhat.com> wrote:
>> On Thu, May 01, 2014 at 01:57:27PM +0200, Christian Engelmayer wrote:
>> > Fix a potential leak in the error path of function update_bcn_wps_ie().
>> > Make sure that allocated memory for 'pbackup_remainder_ie' is freed
>> > upon return. Detected by Coverity - CID 1077718.
>> >
>>
>> if (remainder_ielen > 0) {
>> pbackup_remainder_ie = kmalloc(remainder_ielen, GFP_ATOMIC);
>> if (pbackup_remainder_ie)
>> memcpy(pbackup_remainder_ie, premainder_ie,
>> remainder_ielen);
>> }
>>
>> pwps_ie_src = pmlmepriv->wps_beacon_ie;
>> if (pwps_ie_src == NULL)
>> return;
>>
>>
>> Maybe just check pwps_ie_src earlier?
>>
>
> You are right, I see no reason why this cannot be done early in the function.
Looks good to me - if you send me a patch with a commit message and a
Signed-off-by, I'll add it to the rtl8723au driver tree and push it to
Greg with my next set of changes.
Cheers,
Jes
prev parent reply other threads:[~2014-05-01 21:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-01 11:57 Christian Engelmayer
2014-05-01 12:22 ` Mateusz Guzik
2014-05-01 20:16 ` Christian Engelmayer
2014-05-01 21:46 ` Jes Sorensen [this message]
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=wrfjtx99w4ry.fsf@ultrasam.lan.trained-monkey.org \
--to=jes.sorensen@redhat.com \
--cc=Larry.Finger@lwfinger.net \
--cc=cengelma@gmx.at \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mguzik@redhat.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®