[PATCH v4] drm/ioctl: Add a ioctl to label GEM objects
Dan Carpenter
dan.carpenter at oracle.com
Sat Oct 12 13:35:57 UTC 2019
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 at intel.com>
Reported-by: Dan Carpenter <dan.carpenter at 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
More information about the dri-devel
mailing list