[bug report] drm: re-enable error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Nicholas Mc Guire,

The patch d530b5f1ca0b: "drm: re-enable error handling" from Jul 14,
2018, leads to the following static checker warning:

	drivers/gpu/drm/drm_context.c:375 drm_legacy_addctx()
	warn: unsigned 'ctx->handle' is never less than zero.

drivers/gpu/drm/drm_context.c
   359  int drm_legacy_addctx(struct drm_device *dev, void *data,
   360                        struct drm_file *file_priv)
   361  {
   362          struct drm_ctx_list *ctx_entry;
   363          struct drm_ctx *ctx = data;
   364  
   365          if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
   366              !drm_core_check_feature(dev, DRIVER_LEGACY))
   367                  return -EINVAL;
   368  
   369          ctx->handle = drm_legacy_ctxbitmap_next(dev);
   370          if (ctx->handle == DRM_KERNEL_CONTEXT) {
   371                  /* Skip kernel's context and get a new one. */
   372                  ctx->handle = drm_legacy_ctxbitmap_next(dev);
   373          }
   374          DRM_DEBUG("%d\n", ctx->handle);
   375          if (ctx->handle < 0) {
                    ^^^^^^^^^^^^^^^
This can't be true.

   376                  DRM_DEBUG("Not enough free contexts.\n");
   377                  /* Should this return -EBUSY instead? */
   378                  return -ENOMEM;
   379          }

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux