[PATCH 3/4] drm/plane: add drmm_universal_plane_alloc()
Dan Carpenter
dan.carpenter at oracle.com
Mon Aug 31 09:37:38 UTC 2020
Hi Philipp,
url: https://github.com/0day-ci/linux/commits/Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-m001-20200826 (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 at intel.com>
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
New smatch warnings:
drivers/gpu/drm/drm_plane.c:302 drm_universal_plane_init() error: uninitialized symbol 'ap'.
drivers/gpu/drm/drm_plane.c:345 __drmm_universal_plane_alloc() error: uninitialized symbol 'ap'.
Old smatch warnings:
drivers/gpu/drm/drm_plane.c:117 create_in_format_blob() error: potential null dereference 'blob'. (drm_property_create_blob returns null)
# https://github.com/0day-ci/linux/commit/d809a51da3d2939a84ecf6b4ada8f5be6c3ecb35
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
git checkout d809a51da3d2939a84ecf6b4ada8f5be6c3ecb35
vim +/ap +302 drivers/gpu/drm/drm_plane.c
d809a51da3d293 Philipp Zabel 2020-08-26 287 int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane,
d809a51da3d293 Philipp Zabel 2020-08-26 288 uint32_t possible_crtcs,
d809a51da3d293 Philipp Zabel 2020-08-26 289 const struct drm_plane_funcs *funcs,
d809a51da3d293 Philipp Zabel 2020-08-26 290 const uint32_t *formats, unsigned int format_count,
d809a51da3d293 Philipp Zabel 2020-08-26 291 const uint64_t *format_modifiers,
d809a51da3d293 Philipp Zabel 2020-08-26 292 enum drm_plane_type type,
d809a51da3d293 Philipp Zabel 2020-08-26 293 const char *name, ...)
d809a51da3d293 Philipp Zabel 2020-08-26 294 {
d809a51da3d293 Philipp Zabel 2020-08-26 295 va_list ap;
^^^^^^^^^^
d809a51da3d293 Philipp Zabel 2020-08-26 296 int ret;
d809a51da3d293 Philipp Zabel 2020-08-26 297
d809a51da3d293 Philipp Zabel 2020-08-26 298 if (name)
d809a51da3d293 Philipp Zabel 2020-08-26 299 va_start(ap, name);
^^
d809a51da3d293 Philipp Zabel 2020-08-26 300 ret = __drm_universal_plane_init(dev, plane, possible_crtcs, funcs,
d809a51da3d293 Philipp Zabel 2020-08-26 301 formats, format_count, format_modifiers,
d809a51da3d293 Philipp Zabel 2020-08-26 @302 type, name, ap);
^^
This isn't always initialized. Presumably it's not a problem but
runtime tools like KASan (syzbot) will detect the load and complain as
well so it's probably better to silence it.
d809a51da3d293 Philipp Zabel 2020-08-26 303 if (name)
d809a51da3d293 Philipp Zabel 2020-08-26 304 va_end(ap);
d809a51da3d293 Philipp Zabel 2020-08-26 305 return ret;
d809a51da3d293 Philipp Zabel 2020-08-26 306 }
43968d7b806d7a Daniel Vetter 2016-09-21 307 EXPORT_SYMBOL(drm_universal_plane_init);
43968d7b806d7a Daniel Vetter 2016-09-21 308
d809a51da3d293 Philipp Zabel 2020-08-26 309 static void drmm_universal_plane_alloc_release(struct drm_device *dev, void *ptr)
d809a51da3d293 Philipp Zabel 2020-08-26 310 {
d809a51da3d293 Philipp Zabel 2020-08-26 311 struct drm_plane *plane = ptr;
d809a51da3d293 Philipp Zabel 2020-08-26 312
d809a51da3d293 Philipp Zabel 2020-08-26 313 if (WARN_ON(!plane->dev))
d809a51da3d293 Philipp Zabel 2020-08-26 314 return;
d809a51da3d293 Philipp Zabel 2020-08-26 315
d809a51da3d293 Philipp Zabel 2020-08-26 316 drm_plane_cleanup(plane);
d809a51da3d293 Philipp Zabel 2020-08-26 317 }
d809a51da3d293 Philipp Zabel 2020-08-26 318
d809a51da3d293 Philipp Zabel 2020-08-26 319 void *__drmm_universal_plane_alloc(struct drm_device *dev, size_t size,
d809a51da3d293 Philipp Zabel 2020-08-26 320 size_t offset, uint32_t possible_crtcs,
d809a51da3d293 Philipp Zabel 2020-08-26 321 const struct drm_plane_funcs *funcs,
d809a51da3d293 Philipp Zabel 2020-08-26 322 const uint32_t *formats, unsigned int format_count,
d809a51da3d293 Philipp Zabel 2020-08-26 323 const uint64_t *format_modifiers,
d809a51da3d293 Philipp Zabel 2020-08-26 324 enum drm_plane_type type,
d809a51da3d293 Philipp Zabel 2020-08-26 325 const char *name, ...)
d809a51da3d293 Philipp Zabel 2020-08-26 326 {
d809a51da3d293 Philipp Zabel 2020-08-26 327 void *container;
d809a51da3d293 Philipp Zabel 2020-08-26 328 struct drm_plane *plane;
d809a51da3d293 Philipp Zabel 2020-08-26 329 va_list ap;
d809a51da3d293 Philipp Zabel 2020-08-26 330 int ret;
d809a51da3d293 Philipp Zabel 2020-08-26 331
d809a51da3d293 Philipp Zabel 2020-08-26 332 if (!funcs || funcs->destroy)
d809a51da3d293 Philipp Zabel 2020-08-26 333 return ERR_PTR(-EINVAL);
d809a51da3d293 Philipp Zabel 2020-08-26 334
d809a51da3d293 Philipp Zabel 2020-08-26 335 container = drmm_kzalloc(dev, size, GFP_KERNEL);
d809a51da3d293 Philipp Zabel 2020-08-26 336 if (!container)
d809a51da3d293 Philipp Zabel 2020-08-26 337 return ERR_PTR(-ENOMEM);
d809a51da3d293 Philipp Zabel 2020-08-26 338
d809a51da3d293 Philipp Zabel 2020-08-26 339 plane = container + offset;
d809a51da3d293 Philipp Zabel 2020-08-26 340
d809a51da3d293 Philipp Zabel 2020-08-26 341 if (name)
d809a51da3d293 Philipp Zabel 2020-08-26 342 va_start(ap, name);
d809a51da3d293 Philipp Zabel 2020-08-26 343 ret = __drm_universal_plane_init(dev, plane, possible_crtcs, funcs,
d809a51da3d293 Philipp Zabel 2020-08-26 344 formats, format_count, format_modifiers,
d809a51da3d293 Philipp Zabel 2020-08-26 @345 type, name, ap);
d809a51da3d293 Philipp Zabel 2020-08-26 346 if (name)
d809a51da3d293 Philipp Zabel 2020-08-26 347 va_end(ap);
d809a51da3d293 Philipp Zabel 2020-08-26 348 if (ret)
d809a51da3d293 Philipp Zabel 2020-08-26 349 return ERR_PTR(ret);
d809a51da3d293 Philipp Zabel 2020-08-26 350
d809a51da3d293 Philipp Zabel 2020-08-26 351 ret = drmm_add_action_or_reset(dev, drmm_universal_plane_alloc_release,
d809a51da3d293 Philipp Zabel 2020-08-26 352 plane);
d809a51da3d293 Philipp Zabel 2020-08-26 353 if (ret)
d809a51da3d293 Philipp Zabel 2020-08-26 354 return ERR_PTR(ret);
d809a51da3d293 Philipp Zabel 2020-08-26 355
d809a51da3d293 Philipp Zabel 2020-08-26 356 return container;
d809a51da3d293 Philipp Zabel 2020-08-26 357 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 40635 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200831/926ca879/attachment-0001.gz>
More information about the dri-devel
mailing list