From: "Colin King (gmail)" <colin.i.king@gmail.com>
To: Alexandra Winter <wintera@linux.ibm.com>,
Wenjia Zhang <wenjia@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>,
linux-s390@vger.kernel.org,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: ctcm: rename READ/WRITE defines to avoid redefinitions
Date: Mon, 25 Apr 2022 10:01:58 +0100 [thread overview]
Message-ID: <097f369b-3f3c-9eb6-a446-24f46e4ec59f@gmail.com> (raw)
In-Reply-To: <3572a765-17b4-b2df-e3d5-0d30485c4c67@linux.ibm.com>
On 25/04/2022 09:38, Alexandra Winter wrote:
>
>
> On 24.04.22 20:58, Colin King (gmail) wrote:
>> Hi,
>>
>> static analysis with cppcheck detected a potential null pointer deference with the following commit:
>>
>> commit 3c09e2647b5e1f1f9fd383971468823c2505e1b0
>> Author: Ursula Braun <ursula.braun@de.ibm.com>
>> Date: Thu Aug 12 01:58:28 2010 +0000
>>
>> ctcm: rename READ/WRITE defines to avoid redefinitions
>>
>>
>> The analysis is as follows:
>>
>> drivers/s390/net/ctcm_sysfs.c:43:8: note: Assuming that condition 'priv' is not redundant
>> if (!(priv && priv->channel[CTCM_READ] && ndev)) {
>> ^
>> drivers/s390/net/ctcm_sysfs.c:42:9: note: Null pointer dereference
>> ndev = priv->channel[CTCM_READ]->netdev;
>>
>> The code in question is as follows:
>>
>> ndev = priv->channel[CTCM_READ]->netdev;
>>
>> ^^ priv may be null, as per check below but it is being dereferenced when assigning ndev
>>
>> if (!(priv && priv->channel[CTCM_READ] && ndev)) {
>> CTCM_DBF_TEXT(SETUP, CTC_DBF_ERROR, "bfnondev");
>> return -ENODEV;
>> }
>>
>> Colin
>
> Thank you very much for reporting this, we will provide a patch.
Thanks for working on a fix. Much appreciated.
>
> Do you have any special requests for the Reported-by flag? Or is
> Reported-by: Colin King (gmail) <colin.i.king@gmail.com>
> fine with you?
>
Can I have:
Reported by: Colin Ian King <colin.i.king@gmail.com>
Thank you!
Colin
> Kind regards
> Alexandra
prev parent reply other threads:[~2022-04-25 9:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-24 18:58 ctcm: rename READ/WRITE defines to avoid redefinitions Colin King (gmail)
2022-04-25 8:38 ` Alexandra Winter
2022-04-25 9:01 ` Colin King (gmail) [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=097f369b-3f3c-9eb6-a446-24f46e4ec59f@gmail.com \
--to=colin.i.king@gmail.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wenjia@linux.ibm.com \
--cc=wintera@linux.ibm.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