lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 24 Nov 2015 08:53:07 +0100
From:	Sascha Hauer <s.hauer@...gutronix.de>
To:	dawei chien <dawei.chien@...iatek.com>
Cc:	linux-pm@...r.kernel.org, Zhang Rui <rui.zhang@...el.com>,
	Eduardo Valentin <edubezval@...il.com>,
	linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
	kernel@...gutronix.de, Matthias Brugger <matthias.bgg@...il.com>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 2/3] thermal: Add Mediatek thermal controller support

On Tue, Nov 24, 2015 at 02:06:09PM +0800, dawei chien wrote:
> Hi Sascha,
> 
> > +static int mtk_thermal_get_calibration_data(struct device *dev, struct mtk_thermal *mt)
> > +{
> > +	struct nvmem_cell *cell;
> > +	u32 *buf;
> > +	size_t len;
> > +	int i, ret;
> > +	/* Start with default values */
> > +	mt->adc_ge = 512;
> > +	for (i = 0; i < MT8173_NUM_SENSORS; i++)
> > +		mt->vts[i] = 260;
> > +	mt->degc_cali = 40;
> > +	mt->o_slope = 0;
> > +
> > +	cell = nvmem_cell_get(dev, "calibration-data");
> > +	if (IS_ERR(cell)) {
> > +		if (PTR_ERR(cell) == -EPROBE_DEFER)
> > +			return PTR_ERR(cell);
> > +		return 0;
> > +	}
> > +
> > +	buf = (u32 *)nvmem_cell_read(cell, &len);
> > +
> > +	nvmem_cell_put(cell);
> > +
> > +	if (IS_ERR(buf))
> > +		return PTR_ERR(buf);
> > +
> > +	if (len < 3 * sizeof(u32)) {
> > +		dev_warn(dev, "invalid calibration data\n");
> > +		ret = -EINVAL;
> > +		goto out;
> > +	}
> 
> ret would not be assigned if the length of calibration data is correct.
> Otherwise,

gcc does a increasingly bad job when it comes to warn about
uninitialized variables :(

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ