diff options
author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2014-05-28 04:22:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-30 20:35:23 -0400 |
commit | e95051ff5a0b76e672f6d30e8bb8f93cc11c8018 (patch) | |
tree | efa374a49ad465442f6f926297cc4d98a3c266a8 /drivers | |
parent | 4d520f62e0f4fd310a2307d0244ef184ce9200ba (diff) |
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: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 34993009a9e1..549e9fd5bfdc 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -1013,7 +1013,7 @@ static long __qeth_check_irb_error(struct ccw_device *cdev, | |||
1013 | 1013 | ||
1014 | card = CARD_FROM_CDEV(cdev); | 1014 | card = CARD_FROM_CDEV(cdev); |
1015 | 1015 | ||
1016 | if (!IS_ERR(irb)) | 1016 | if (!card || !IS_ERR(irb)) |
1017 | return 0; | 1017 | return 0; |
1018 | 1018 | ||
1019 | switch (PTR_ERR(irb)) { | 1019 | switch (PTR_ERR(irb)) { |
@@ -1029,7 +1029,7 @@ static long __qeth_check_irb_error(struct ccw_device *cdev, | |||
1029 | QETH_CARD_TEXT(card, 2, "ckirberr"); | 1029 | QETH_CARD_TEXT(card, 2, "ckirberr"); |
1030 | QETH_CARD_TEXT_(card, 2, " rc%d", -ETIMEDOUT); | 1030 | QETH_CARD_TEXT_(card, 2, " rc%d", -ETIMEDOUT); |
1031 | if (intparm == QETH_RCD_PARM) { | 1031 | if (intparm == QETH_RCD_PARM) { |
1032 | if (card && (card->data.ccwdev == cdev)) { | 1032 | if (card->data.ccwdev == cdev) { |
1033 | card->data.state = CH_STATE_DOWN; | 1033 | card->data.state = CH_STATE_DOWN; |
1034 | wake_up(&card->wait_q); | 1034 | wake_up(&card->wait_q); |
1035 | } | 1035 | } |