summaryrefslogtreecommitdiffstats
path: root/drivers/staging/slicoss
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2013-02-19 05:13:50 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-11 09:22:43 -0700
commit81372118c6fc12d41b6e978b915cc010fe6e5700 (patch)
tree06a6b4ebf7db027b6012ae73834dc04b08150361 /drivers/staging/slicoss
parent4fcf94980c994ed992d8efd1424bd842225f1cc6 (diff)
downloadtalos-obmc-linux-81372118c6fc12d41b6e978b915cc010fe6e5700.tar.gz
talos-obmc-linux-81372118c6fc12d41b6e978b915cc010fe6e5700.zip
staging/slicoss: Check pointer before dereferencing
Smatch complains that the variable adapter is dereferenced before it is checked: slicoss.c:906 slic_timer_load_check() warn: variable dereferenced before check 'adapter' (see line 904) -> move the assignment after the check. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/slicoss')
-rw-r--r--drivers/staging/slicoss/slicoss.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 76fc2e554f35..753993c867fa 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -901,10 +901,9 @@ static void slic_timer_load_check(ulong cardaddr)
u32 load = card->events;
u32 level = 0;
- intagg = &adapter->slic_regs->slic_intagg;
-
if ((adapter) && (adapter->state == ADAPT_UP) &&
(card->state == CARD_UP) && (slic_global.dynamic_intagg)) {
+ intagg = &adapter->slic_regs->slic_intagg;
if (adapter->devid == SLIC_1GB_DEVICE_ID) {
if (adapter->linkspeed == LINK_1000MB)
level = 100;
OpenPOWER on IntegriCloud