dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Rohan Garg <rohan.garg@collabora.com>
Cc: kernel@collabora.com, kbuild-all@lists.01.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4] drm/ioctl: Add a ioctl to label GEM objects
Date: Sat, 12 Oct 2019 16:35:57 +0300	[thread overview]
Message-ID: <20191012133557.GV13286@kadam> (raw)
In-Reply-To: <20191011143009.17503-1-rohan.garg@collabora.com>

Hi Rohan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.4-rc2 next-20191011]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Rohan-Garg/drm-ioctl-Add-a-ioctl-to-label-GEM-objects/20191012-062955

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

smatch warnings:
drivers/gpu/drm/drm_gem.c:967 drm_dumb_set_label_ioctl() error: 'label' dereferencing possible ERR_PTR()

# https://github.com/0day-ci/linux/commit/0f0cd7ef9f3b1623ab982f12dc748998f31e10b4
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 0f0cd7ef9f3b1623ab982f12dc748998f31e10b4
vim +/label +967 drivers/gpu/drm/drm_gem.c

673a394b1e3b69 Eric Anholt 2008-07-30  943  
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  944  int drm_dumb_set_label_ioctl(struct drm_device *dev,
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  945  				void *data, struct drm_file *file_priv)
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  946  {
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  947  	char *label;
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  948  	struct drm_dumb_set_label_object *args = data;
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  949  	int ret = 0;
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  950  
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  951  	if (!args->len || !args->name)
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  952  		return -EINVAL;
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  953  
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  954  	if (!dev->driver->label)
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  955  		return -EOPNOTSUPP;
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  956  
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  957  	label = strndup_user(u64_to_user_ptr(args->name), args->len);
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  958  
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  959  	if (IS_ERR(label)) {
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  960  		ret = PTR_ERR(label);
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  961  		goto err;
                                                        ^^^^^^^^
Just return PTR_ERR(label);


0f0cd7ef9f3b16 Rohan Garg  2019-10-11  962  	}
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  963  
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  964  	ret = dev->driver->label(dev, file_priv, args->handle, label);
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  965  
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  966  err:
0f0cd7ef9f3b16 Rohan Garg  2019-10-11 @967  	kfree(label);
                                                ^^^^^^^^^^^^
This will Oops.

0f0cd7ef9f3b16 Rohan Garg  2019-10-11  968  	return ret;
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  969  }
0f0cd7ef9f3b16 Rohan Garg  2019-10-11  970  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-10-12 13:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 14:30 [PATCH v4] drm/ioctl: Add a ioctl to label GEM objects Rohan Garg
2019-10-11 17:09 ` Daniel Stone
2019-10-11 17:55   ` Thomas Zimmermann
2019-10-14  8:58     ` Daniel Vetter
2019-10-22  8:58     ` Rohan Garg
2019-10-22  8:58   ` Rohan Garg
2019-10-11 17:31 ` Boris Brezillon
2019-10-12 13:35 ` Dan Carpenter [this message]
2019-10-14  8:59 ` Daniel Vetter
2019-10-22  8:58   ` Rohan Garg
2019-10-22  9:30     ` Daniel Vetter
2019-10-22 13:14       ` Daniel Stone

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=20191012133557.GV13286@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=kernel@collabora.com \
    --cc=rohan.garg@collabora.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