From: Frank Blaschka <blaschka@linux.vnet.ibm.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Ursula Braun <ursula.braun@de.ibm.com>,
linux390@de.ibm.com, Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390: net: qeth_core_main.c: Fix for possible null pointer dereference
Date: Mon, 19 May 2014 10:30:10 +0200 [thread overview]
Message-ID: <20140519083010.GA44089@tuxmaker.boeblingen.de.ibm.com> (raw)
In-Reply-To: <1400429068-10607-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
On Sun, May 18, 2014 at 06:04:27PM +0200, Rickard Strandqvist wrote:
> There is otherwise a risk of a possible null pointer dereference.
>
> Was largely found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Added to my patch queue. Thx!
> ---
> drivers/s390/net/qeth_core_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
> index 22470a3..5562665 100644
> --- a/drivers/s390/net/qeth_core_main.c
> +++ b/drivers/s390/net/qeth_core_main.c
> @@ -1012,7 +1012,7 @@ static long __qeth_check_irb_error(struct ccw_device *cdev,
>
> card = CARD_FROM_CDEV(cdev);
>
> - if (!IS_ERR(irb))
> + if (!card || !IS_ERR(irb))
> return 0;
>
> switch (PTR_ERR(irb)) {
> @@ -1028,7 +1028,7 @@ static long __qeth_check_irb_error(struct ccw_device *cdev,
> QETH_CARD_TEXT(card, 2, "ckirberr");
> QETH_CARD_TEXT_(card, 2, " rc%d", -ETIMEDOUT);
> if (intparm == QETH_RCD_PARM) {
> - if (card && (card->data.ccwdev == cdev)) {
> + if (card->data.ccwdev == cdev) {
> card->data.state = CH_STATE_DOWN;
> wake_up(&card->wait_q);
> }
> --
> 1.7.10.4
>
prev parent reply other threads:[~2014-05-19 8:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 16:04 [PATCH] s390: net: qeth_core_main.c: Fix for possible null pointer dereference Rickard Strandqvist
2014-05-19 8:30 ` Frank Blaschka [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=20140519083010.GA44089@tuxmaker.boeblingen.de.ibm.com \
--to=blaschka@linux.vnet.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=schwidefsky@de.ibm.com \
--cc=ursula.braun@de.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;
as well as URLs for NNTP newsgroup(s).