From: Nicholas Mc Guire <der.herr@hofr.at>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: dri-devel@lists.freedesktop.org, hofrat@osadl.org
Subject: Re: [bug report] drm: re-enable error handling
Date: Thu, 19 Jul 2018 08:22:21 +0000 [thread overview]
Message-ID: <20180719082221.GA21094@osadl.at> (raw)
In-Reply-To: <20180719081030.uehyletdsswhmqk4@mwanda>
On Thu, Jul 19, 2018 at 11:10:30AM +0300, Dan Carpenter wrote:
> 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.
yup this was also reported by kbuild test robot <lkp@intel.com> and
(hopfully correctly) fixed in [PATCH V3] drm: handle error values properly
see http://lkml.org/lkml/2018/7/18/191
thx!
hofrat
>
> 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2018-07-19 8:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 8:10 [bug report] drm: re-enable error handling Dan Carpenter
2018-07-19 8:22 ` Nicholas Mc Guire [this message]
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=20180719082221.GA21094@osadl.at \
--to=der.herr@hofr.at \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hofrat@osadl.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.