dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: ville.syrjala@linux.intel.com
Cc: "Daniel Díaz" <daniel.diaz@linaro.org>,
	kv-team <kv-team@linaro.org>,
	"Naresh Kamboju" <naresh.kamboju@linaro.org>,
	dri-devel@lists.freedesktop.org,
	"Arthur Grillo" <arthurgrillo@riseup.net>,
	kunit-dev@googlegroups.com
Subject: Re: [bug report] drm: Warn about negative sizes when calculating scale factor
Date: Fri, 20 Oct 2023 14:39:04 +0300	[thread overview]
Message-ID: <2ad54714-b1b2-4454-95d4-c46fae4c9404@kadam.mountain> (raw)
In-Reply-To: <c7f0fd2f-a48d-4120-9291-a0cc58faadce@moroto.mountain>

On Wed, Oct 18, 2023 at 05:17:42PM +0300, Dan Carpenter wrote:
> drivers/gpu/drm/drm_rect.c
>    134  static int drm_calc_scale(int src, int dst)
>    135  {
>    136          int scale = 0;
>    137  
>    138          if (WARN_ON(src < 0 || dst < 0))
>                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> These days, with automated fuzz testing, this WARN_ON() is problematic.
> WARN() is considered a kernel bug, and pr_warn() is the hip new way to
> alert the user about issues.

Btw, a lot of people (Greg claims it's the majority of Linux users)
these days have run kernels with panic on warn enabled so that's another
reason to avoid using WARN_ON() for stuff that it known to be possible.

regards,
dan carpenter


  reply	other threads:[~2023-10-20 11:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 14:17 [bug report] drm: Warn about negative sizes when calculating scale factor Dan Carpenter
2023-10-20 11:39 ` Dan Carpenter [this message]
2023-10-20 11:55   ` Ville Syrjälä
2023-10-20 14:11     ` Dan Carpenter

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=2ad54714-b1b2-4454-95d4-c46fae4c9404@kadam.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=arthurgrillo@riseup.net \
    --cc=daniel.diaz@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=kv-team@linaro.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=ville.syrjala@linux.intel.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;
as well as URLs for NNTP newsgroup(s).