Skip to contentSkip to conversation

thermal: tegra: add thermtrip function

DISCUSSION Dan Carpenter 2 participants 2 messages Apr 2, 2016 – Apr 6, 2016 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

Hello Wei Ni,

This is a semi-automatic email about new static checker warnings.

The patch ee6d79f202a4: "thermal: tegra: add thermtrip function" from Mar 29, 2016, leads to the following Smatch complaint:

drivers/thermal/tegra/soctherm.c:226 thermtrip_program()
warn: variable dereferenced before check 'dev' (see line 222)

drivers/thermal/tegra/soctherm.c
221 {

   222		struct tegra_soctherm *ts = dev_get_drvdata(dev);
                                            ^^^^^^^^^^^^^^^^^^^

Dereference inside function.

223 int temp;
224 u32 r;
225
226 if (!dev || !sg)

                    ^^^^

Too late.

227 return -EINVAL;
228

regards,
dan carpenter

#1 lore raw

Thanks for your check, I will send out patch to fix it.

Thanks.
Wei.

Quoted 29 lines · Dan Carpenter

Hello Wei Ni,

This is a semi-automatic email about new static checker warnings.

The patch ee6d79f202a4: "thermal: tegra: add thermtrip function" from Mar 29, 2016, leads to the following Smatch complaint:

drivers/thermal/tegra/soctherm.c:226 thermtrip_program()
warn: variable dereferenced before check 'dev' (see line 222)

drivers/thermal/tegra/soctherm.c

   221	{
   222		struct tegra_soctherm *ts = dev_get_drvdata(dev);
                                            ^^^^^^^^^^^^^^^^^^^

Dereference inside function.

   223		int temp;
   224		u32 r;
   225	
   226		if (!dev || !sg)
                    ^^^^

Too late.

   227			return -EINVAL;
   228	

regards,
dan carpenter