All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH v6] drm: Use USB controller's DMA mask when importing dmabufs
Date: Wed, 03 Mar 2021 08:51:13 +0300	[thread overview]
Message-ID: <20210303055113.GY2087@kadam> (raw)
In-Reply-To: <20210301093127.11028-1-tzimmermann@suse.de>

[-- Attachment #1: Type: text/plain, Size: 4748 bytes --]

Hi Thomas,

url:    https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Use-USB-controller-s-DMA-mask-when-importing-dmabufs/20210301-173210
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: x86_64-randconfig-m001-20210302 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/drm/tiny/gm12u320.c:662 gm12u320_usb_probe() error: potentially dereferencing uninitialized 'dev'.

vim +/dev +662 drivers/gpu/drm/tiny/gm12u320.c

e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  643  static int gm12u320_usb_probe(struct usb_interface *interface,
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  644  			      const struct usb_device_id *id)
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  645  {
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  646  	struct gm12u320_device *gm12u320;
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  647  	struct drm_device *dev;
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  648  	int ret;
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  649  
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  650  	/*
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  651  	 * The gm12u320 presents itself to the system as 2 usb mass-storage
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  652  	 * interfaces, we only care about / need the first one.
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  653  	 */
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  654  	if (interface->cur_altsetting->desc.bInterfaceNumber != 0)
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  655  		return -ENODEV;
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  656  
9213142d6b8c90 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-04-15  657  	gm12u320 = devm_drm_dev_alloc(&interface->dev, &gm12u320_drm_driver,
9213142d6b8c90 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-04-15  658  				      struct gm12u320_device, dev);
9213142d6b8c90 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-04-15  659  	if (IS_ERR(gm12u320))
9213142d6b8c90 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-04-15  660  		return PTR_ERR(gm12u320);
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  661  
6ad12fb4c01449 drivers/gpu/drm/tiny/gm12u320.c     Thomas Zimmermann 2021-03-01 @662  	gm12u320->dmadev = usb_intf_get_dma_device(to_usb_interface(dev->dev));
                                                                                                                                                    ^^^^^^^^
"dev" isn't initalized until a few lines later.

6ad12fb4c01449 drivers/gpu/drm/tiny/gm12u320.c     Thomas Zimmermann 2021-03-01  663  	if (!gm12u320->dmadev)
6ad12fb4c01449 drivers/gpu/drm/tiny/gm12u320.c     Thomas Zimmermann 2021-03-01  664  		drm_warn(dev, "buffer sharing not supported"); /* not an error */
6ad12fb4c01449 drivers/gpu/drm/tiny/gm12u320.c     Thomas Zimmermann 2021-03-01  665  
8f2cb9379fb4ab drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-03-23  666  	INIT_DELAYED_WORK(&gm12u320->fb_update.work, gm12u320_fb_update_work);
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  667  	mutex_init(&gm12u320->fb_update.lock);
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  668  
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  669  	dev = &gm12u320->dev;
                                                                                        ^^^^^^^^^^^^^^^^^^^^

e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  670  
08373edcb9a87e drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-03-23  671  	ret = drmm_mode_config_init(dev);
08373edcb9a87e drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-03-23  672  	if (ret)
993f5b193d1455 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-03-23  673  		return ret;

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36655 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v6] drm: Use USB controller's DMA mask when importing dmabufs
Date: Wed, 03 Mar 2021 08:51:13 +0300	[thread overview]
Message-ID: <20210303055113.GY2087@kadam> (raw)
In-Reply-To: <20210301093127.11028-1-tzimmermann@suse.de>

[-- Attachment #1: Type: text/plain, Size: 4748 bytes --]

Hi Thomas,

url:    https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Use-USB-controller-s-DMA-mask-when-importing-dmabufs/20210301-173210
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: x86_64-randconfig-m001-20210302 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/drm/tiny/gm12u320.c:662 gm12u320_usb_probe() error: potentially dereferencing uninitialized 'dev'.

vim +/dev +662 drivers/gpu/drm/tiny/gm12u320.c

e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  643  static int gm12u320_usb_probe(struct usb_interface *interface,
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  644  			      const struct usb_device_id *id)
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  645  {
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  646  	struct gm12u320_device *gm12u320;
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  647  	struct drm_device *dev;
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  648  	int ret;
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  649  
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  650  	/*
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  651  	 * The gm12u320 presents itself to the system as 2 usb mass-storage
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  652  	 * interfaces, we only care about / need the first one.
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  653  	 */
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  654  	if (interface->cur_altsetting->desc.bInterfaceNumber != 0)
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  655  		return -ENODEV;
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  656  
9213142d6b8c90 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-04-15  657  	gm12u320 = devm_drm_dev_alloc(&interface->dev, &gm12u320_drm_driver,
9213142d6b8c90 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-04-15  658  				      struct gm12u320_device, dev);
9213142d6b8c90 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-04-15  659  	if (IS_ERR(gm12u320))
9213142d6b8c90 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-04-15  660  		return PTR_ERR(gm12u320);
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  661  
6ad12fb4c01449 drivers/gpu/drm/tiny/gm12u320.c     Thomas Zimmermann 2021-03-01 @662  	gm12u320->dmadev = usb_intf_get_dma_device(to_usb_interface(dev->dev));
                                                                                                                                                    ^^^^^^^^
"dev" isn't initalized until a few lines later.

6ad12fb4c01449 drivers/gpu/drm/tiny/gm12u320.c     Thomas Zimmermann 2021-03-01  663  	if (!gm12u320->dmadev)
6ad12fb4c01449 drivers/gpu/drm/tiny/gm12u320.c     Thomas Zimmermann 2021-03-01  664  		drm_warn(dev, "buffer sharing not supported"); /* not an error */
6ad12fb4c01449 drivers/gpu/drm/tiny/gm12u320.c     Thomas Zimmermann 2021-03-01  665  
8f2cb9379fb4ab drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-03-23  666  	INIT_DELAYED_WORK(&gm12u320->fb_update.work, gm12u320_fb_update_work);
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  667  	mutex_init(&gm12u320->fb_update.lock);
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  668  
e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  669  	dev = &gm12u320->dev;
                                                                                        ^^^^^^^^^^^^^^^^^^^^

e4f86e43716443 drivers/gpu/drm/gm12u320/gm12u320.c Hans de Goede     2019-07-21  670  
08373edcb9a87e drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-03-23  671  	ret = drmm_mode_config_init(dev);
08373edcb9a87e drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-03-23  672  	if (ret)
993f5b193d1455 drivers/gpu/drm/tiny/gm12u320.c     Daniel Vetter     2020-03-23  673  		return ret;

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36655 bytes --]

  parent reply	other threads:[~2021-03-03  5:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01  9:31 [PATCH v6] drm: Use USB controller's DMA mask when importing dmabufs Thomas Zimmermann
2021-03-01  9:31 ` Thomas Zimmermann
2021-03-02  9:45 ` Thomas Zimmermann
2021-03-02  9:45   ` Thomas Zimmermann
2021-03-02  9:56 ` Greg KH
2021-03-02  9:56   ` Greg KH
2021-03-03  5:51 ` Dan Carpenter [this message]
2021-03-03  5:51   ` Dan Carpenter
2021-03-03  8:25   ` Thomas Zimmermann
  -- strict thread matches above, loose matches on Subject: below --
2021-03-02 18:47 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210303055113.GY2087@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.