[linux-stable-rc:linux-4.14.y 9124/9999] drivers/media/usb/dvb-usb/af9005.c:990:48: warning: suggest braces around empty body in an 'if' statement

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
head:   bb01d00d3d36750e338cb76df7febc1f725a1cdd
commit: 2d7c27957cac081eeacea7c38d8c9c59049883dc [9124/9999] media: usb: fix memory leak in af9005_identify_state
config: x86_64-buildonly-randconfig-r004-20210630 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=2d7c27957cac081eeacea7c38d8c9c59049883dc
        git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
        git fetch --no-tags linux-stable-rc linux-4.14.y
        git checkout 2d7c27957cac081eeacea7c38d8c9c59049883dc
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/media/usb/dvb-usb/af9005.c: In function 'af9005_read_ofdm_register':
   drivers/media/usb/dvb-usb/af9005.c:153:32: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
      deb_reg("value %x\n", *value);
                                   ^
   drivers/media/usb/dvb-usb/af9005.c: In function 'af9005_read_ofdm_registers':
   drivers/media/usb/dvb-usb/af9005.c:168:35: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
      debug_dump(values, len, deb_reg);
                                      ^
   drivers/media/usb/dvb-usb/af9005.c: In function 'af9005_write_ofdm_register':
   drivers/media/usb/dvb-usb/af9005.c:183:18: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
      deb_reg("ok\n");
                     ^
   drivers/media/usb/dvb-usb/af9005.c: In function 'af9005_write_ofdm_registers':
   drivers/media/usb/dvb-usb/af9005.c:200:18: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
      deb_reg("ok\n");
                     ^
   drivers/media/usb/dvb-usb/af9005.c: In function 'af9005_identify_state':
>> drivers/media/usb/dvb-usb/af9005.c:990:48: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
      deb_info("Identify state cold = %d\n", *cold);
                                                   ^


vim +/if +990 drivers/media/usb/dvb-usb/af9005.c

af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  965  
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  966  static int af9005_identify_state(struct usb_device *udev,
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  967  				 struct dvb_usb_device_properties *props,
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  968  				 struct dvb_usb_device_description **desc,
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  969  				 int *cold)
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  970  {
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  971  	int ret;
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  972  	u8 reply, *buf;
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  973  
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  974  	buf = kmalloc(FW_BULKOUT_SIZE + 2, GFP_KERNEL);
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  975  	if (!buf)
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  976  		return -ENOMEM;
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  977  
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  978  	ret = af9005_boot_packet(udev, FW_CONFIG, &reply,
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  979  				 buf, FW_BULKOUT_SIZE + 2);
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  980  	if (ret)
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  981  		goto err;
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  982  	deb_info("result of FW_CONFIG in identify state %d\n", reply);
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  983  	if (reply == 0x01)
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  984  		*cold = 1;
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  985  	else if (reply == 0x02)
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  986  		*cold = 0;
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  987  	else
2d7c27957cac08 drivers/media/usb/dvb-usb/af9005.c Navid Emamdoost       2019-10-09  988  		ret = -EIO;
2d7c27957cac08 drivers/media/usb/dvb-usb/af9005.c Navid Emamdoost       2019-10-09  989  	if (!ret)
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07 @990  		deb_info("Identify state cold = %d\n", *cold);
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  991  
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  992  err:
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  993  	kfree(buf);
c58b84ee467bfd drivers/media/usb/dvb-usb/af9005.c Mauro Carvalho Chehab 2016-10-05  994  	return ret;
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  995  }
af4e067e1dcf92 drivers/media/dvb/dvb-usb/af9005.c Luca Olivetti         2007-05-07  996  

:::::: The code at line 990 was first introduced by commit
:::::: af4e067e1dcf926d9523dff11e46c45fd9fa9da2 V4L/DVB (5625): Add support for the AF9005 demodulator from Afatech

:::::: TO: Luca Olivetti <luca@xxxxxxxxxxx>
:::::: CC: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[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