Commit e95051ff authored by Rickard Strandqvist's avatar Rickard Strandqvist Committed by David S. Miller

qeth: Fix for possible null pointer dereference

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: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: default avatarFrank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4d520f62
...@@ -1013,7 +1013,7 @@ static long __qeth_check_irb_error(struct ccw_device *cdev, ...@@ -1013,7 +1013,7 @@ static long __qeth_check_irb_error(struct ccw_device *cdev,
card = CARD_FROM_CDEV(cdev); card = CARD_FROM_CDEV(cdev);
if (!IS_ERR(irb)) if (!card || !IS_ERR(irb))
return 0; return 0;
switch (PTR_ERR(irb)) { switch (PTR_ERR(irb)) {
...@@ -1029,7 +1029,7 @@ static long __qeth_check_irb_error(struct ccw_device *cdev, ...@@ -1029,7 +1029,7 @@ static long __qeth_check_irb_error(struct ccw_device *cdev,
QETH_CARD_TEXT(card, 2, "ckirberr"); QETH_CARD_TEXT(card, 2, "ckirberr");
QETH_CARD_TEXT_(card, 2, " rc%d", -ETIMEDOUT); QETH_CARD_TEXT_(card, 2, " rc%d", -ETIMEDOUT);
if (intparm == QETH_RCD_PARM) { if (intparm == QETH_RCD_PARM) {
if (card && (card->data.ccwdev == cdev)) { if (card->data.ccwdev == cdev) {
card->data.state = CH_STATE_DOWN; card->data.state = CH_STATE_DOWN;
wake_up(&card->wait_q); wake_up(&card->wait_q);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment