linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: mchehab@osg.samsung.com
Cc: linux-media@vger.kernel.org
Subject: re: [media] em28xx: add media controller support
Date: Wed, 3 Feb 2016 07:42:02 +0300	[thread overview]
Message-ID: <20160203044202.GA12152@mwanda> (raw)

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

                 reply	other threads:[~2016-02-03  4:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160203044202.GA12152@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /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 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).