Re: [PATCH v2] [media] au8522: Avoid memory leak for device config data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mauro,

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.4-rc6 next-20151221]

url:    https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/au8522-Avoid-memory-leak-for-device-config-data/20151222-010649
base:   git://linuxtv.org/media_tree.git master
config: x86_64-randconfig-x000-201551 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/media/dvb-frontends/au8522_decoder.c: In function 'au8522_probe':
>> drivers/media/dvb-frontends/au8522_decoder.c:779:3: warning: 'demod_config' may be used uninitialized in this function [-Wmaybe-uninitialized]
      kfree(demod_config);
      ^

vim +/demod_config +779 drivers/media/dvb-frontends/au8522_decoder.c

5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  763  	hdl = &state->hdl;
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  764  	v4l2_ctrl_handler_init(hdl, 4);
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  765  	v4l2_ctrl_new_std(hdl, &au8522_ctrl_ops,
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  766  			V4L2_CID_BRIGHTNESS, 0, 255, 1, 109);
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  767  	v4l2_ctrl_new_std(hdl, &au8522_ctrl_ops,
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  768  			V4L2_CID_CONTRAST, 0, 255, 1,
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  769  			AU8522_TVDEC_CONTRAST_REG00BH_CVBS);
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  770  	v4l2_ctrl_new_std(hdl, &au8522_ctrl_ops,
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  771  			V4L2_CID_SATURATION, 0, 255, 1, 128);
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  772  	v4l2_ctrl_new_std(hdl, &au8522_ctrl_ops,
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  773  			V4L2_CID_HUE, -32768, 32767, 1, 0);
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  774  	sd->ctrl_handler = hdl;
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  775  	if (hdl->error) {
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  776  		int err = hdl->error;
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  777  
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  778  		v4l2_ctrl_handler_free(hdl);
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15 @779  		kfree(demod_config);
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  780  		kfree(state);
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  781  		return err;
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  782  	}
5a4bdb4b drivers/media/dvb-frontends/au8522_decoder.c Hans Verkuil          2013-02-15  783  
968cf782 drivers/media/dvb/frontends/au8522_decoder.c Devin Heitmueller     2009-03-11  784  	state->c = client;
f2fd7ce6 drivers/media/dvb-frontends/au8522_decoder.c Mauro Carvalho Chehab 2014-06-08  785  	state->std = V4L2_STD_NTSC_M;
968cf782 drivers/media/dvb/frontends/au8522_decoder.c Devin Heitmueller     2009-03-11  786  	state->vid_input = AU8522_COMPOSITE_CH1;
968cf782 drivers/media/dvb/frontends/au8522_decoder.c Devin Heitmueller     2009-03-11  787  	state->aud_input = AU8522_AUDIO_NONE;

:::::: The code at line 779 was first introduced by commit
:::::: 5a4bdb4b34b90655891f627679bbba0ed9791c2e [media] au8522_decoder: convert to the control framework

:::::: TO: Hans Verkuil <hans.verkuil@xxxxxxxxx>
:::::: CC: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: Binary data


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux