2016-04-13 13:24 GMT+02:00 Dan Carpenter <dan.carpenter@xxxxxxxxxx>: > Hello Anand Kumar Santhanam, > > The patch 279094079a44: "[SCSI] pm80xx: Phy settings support for > motherboard controller." from Sep 18, 2013, leads to the following > static checker warning: > > drivers/scsi/pm8001/pm80xx_hwi.c:4554 mpi_set_phy_profile_req() > error: uninitialized symbol 'tag'. > Thanks for reporting, attached patch should fix the warning.
From e30af801d9ee9979b2a7a2af815cb395c2255a09 Mon Sep 17 00:00:00 2001 From: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxxx> Date: Thu, 14 Apr 2016 14:38:57 +0200 Subject: [PATCH] pm80xx: avoid to use invalid tag Fix static checker warning: drivers/scsi/pm8001/pm80xx_hwi.c:4554 mpi_set_phy_profile_req() error: uninitialized symbol 'tag'. Reported-by: Dan Carpenter dan.carpenter@xxxxxxxxxx Signed-off-by: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxxx> --- drivers/scsi/pm8001/pm80xx_hwi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index eb4fee6..a3c1c08 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -4548,8 +4548,10 @@ void mpi_set_phy_profile_req(struct pm8001_hba_info *pm8001_ha, memset(&payload, 0, sizeof(payload)); rc = pm8001_tag_alloc(pm8001_ha, &tag); - if (rc) + if (rc) { PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("Invalid tag\n")); + return; + } circularQ = &pm8001_ha->inbnd_q_tbl[0]; payload.tag = cpu_to_le32(tag); payload.ppc_phyid = (((operation & 0xF) << 8) | (phyid & 0xFF)); @@ -4590,8 +4592,10 @@ void pm8001_set_phy_profile_single(struct pm8001_hba_info *pm8001_ha, memset(&payload, 0, sizeof(payload)); rc = pm8001_tag_alloc(pm8001_ha, &tag); - if (rc) + if (rc) { PM8001_INIT_DBG(pm8001_ha, pm8001_printk("Invalid tag")); + return; + } circularQ = &pm8001_ha->inbnd_q_tbl[0]; opc = OPC_INB_SET_PHY_PROFILE; -- 1.9.1