linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: [media] em28xx: add media controller support
@ 2016-02-03  4:42 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-02-03  4:42 UTC (permalink / raw)
  To: mchehab; +Cc: linux-media

Hello Mauro Carvalho Chehab,

The patch 37ecc7b1278f: "[media] em28xx: add media controller
support" from Jan 27, 2016, leads to the following static checker
warning:

	drivers/media/usb/em28xx/em28xx-cards.c:3028 em28xx_media_device_init()
	warn: this array is probably non-NULL. 'dev->name'

drivers/media/usb/em28xx/em28xx-cards.c
  3016  static int em28xx_media_device_init(struct em28xx *dev,
  3017                                      struct usb_device *udev)
  3018  {
  3019  #ifdef CONFIG_MEDIA_CONTROLLER
  3020          struct media_device *mdev;
  3021  
  3022          mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
  3023          if (!mdev)
  3024                  return -ENOMEM;
  3025  
  3026          mdev->dev = &udev->dev;
  3027  
  3028          if (!dev->name)
  3029                  strlcpy(mdev->model, "unknown em28xx", sizeof(mdev->model));
  3030          else
  3031                  strlcpy(mdev->model, dev->name, sizeof(mdev->model));

We either want to remove the NULL test or test for the empty string.

  3032          if (udev->serial)
  3033                  strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial));
  3034          strcpy(mdev->bus_info, udev->devpath);
  3035          mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
  3036          mdev->driver_version = LINUX_VERSION_CODE;
  3037  
  3038          media_device_init(mdev);
  3039  
  3040          dev->media_dev = mdev;
  3041  #endif
  3042          return 0;
  3043  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-03  4:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-03  4:42 [media] em28xx: add media controller support Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).