[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1361247234-1754-1-git-send-email-peterhuewe@gmx.de>
Date: Tue, 19 Feb 2013 05:13:50 +0100
From: Peter Huewe <peterhuewe@....de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Devendra Naga <devendra.aaru@...il.com>,
Peter Huewe <peterhuewe@....de>,
Bill Pemberton <wfp5p@...ginia.edu>,
Cruz Julian Bishop <cruzjbishop@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/5] 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@....de>
---
drivers/staging/slicoss/slicoss.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 76fc2e5..753993c 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;
--
1.7.8.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists