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

Kronos
2004-02-02T20:03:06Z

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@kronoz.cjb.net
Home: http://kronoz.cjb.net
Runtime error 6D at f000:a12f : user incompetente