[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-s390
Subject:    Re: [PATCH] s390: net: qeth_core_main.c:  Fix for possible null pointer dereference
From:       Frank Blaschka <blaschka () linux ! vnet ! ibm ! com>
Date:       2014-05-19 8:30:10
Message-ID: 20140519083010.GA44089 () tuxmaker ! boeblingen ! de ! ibm ! com
[Download RAW message or body]

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
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic