[Compile Regression in 2.4.25-pre8][PATCH 31/42]

From: Kronos
Date: Mon Feb 02 2004 - 15:39:14 EST



mptbase.c:2906: warning: `pCached' might be used uninitialized in this function

Initialize pCached to NULL.
Avoid printing if pCached is NULL.

diff -Nru -X dontdiff linux-2.4-vanilla/drivers/message/fusion/mptbase.c linux-2.4/drivers/message/fusion/mptbase.c
--- linux-2.4-vanilla/drivers/message/fusion/mptbase.c Sat Jan 31 15:54:42 2004
+++ linux-2.4/drivers/message/fusion/mptbase.c Sat Jan 31 21:34:47 2004
@@ -2903,7 +2903,7 @@
{
MpiFwHeader_t *FwHdr;
MpiExtImageHeader_t *ExtHdr;
- fw_image_t **pCached;
+ fw_image_t **pCached = NULL;
int fw_sz;
u32 diag0val;
#ifdef MPT_DEBUG
@@ -2944,11 +2944,11 @@
pCached = (fw_image_t **)ioc->cached_fw;
else if (ioc->alt_ioc && (ioc->alt_ioc->cached_fw != NULL))
pCached = (fw_image_t **)ioc->alt_ioc->cached_fw;
-
- ddlprintk((MYIOC_s_INFO_FMT "DbGb2: FW Image @ %p\n",
- ioc->name, pCached));
if (!pCached)
return -2;
+
+ ddlprintk((MYIOC_s_INFO_FMT "DbGb2: FW Image @ %p\n",
+ ioc->name, pCached));

/* Write magic sequence to WriteSequence register
* until enter diagnostic mode

--
Reply-To: kronos@xxxxxxxxxxxxxx
Home: http://kronoz.cjb.net
Runtime error 6D at f000:a12f : user incompetente
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/