All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "David Airlie" <airlied@linux.ie>,
	"Derek Basehore" <dbasehore@chromium.org>,
	dri-devel@lists.freedesktop.org,
	"Sean Paul" <seanpaul@chromium.org>,
	"Daniel Vetter" <daniel.vetter@intel.com>,
	"Mathieu Alexandre-Tétreault" <alexandretm@amotus.ca>
Subject: Re: [PATCH v2 11/13] drm/modes: parse_cmdline: Explicitly memset the passed in drm_cmdline_mode struct
Date: Mon, 18 Nov 2019 13:28:16 +0100	[thread overview]
Message-ID: <20191118122816.GJ4345@gilmour.lan> (raw)
In-Reply-To: <20191113164434.254159-11-hdegoede@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1362 bytes --]

On Wed, Nov 13, 2019 at 05:44:32PM +0100, Hans de Goede wrote:
> Instead of only setting mode->specified on false on an early exit and
> leaving e.g. mode->bpp_specified and mode->refresh_specified as is,
> lets be consistent and just zero out the entire passed in struct at
> the top of drm_mode_parse_command_line_for_connector()
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/gpu/drm/drm_modes.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index beb764efe6b3..1fee4a71eff7 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -1745,12 +1745,11 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
>  	char *bpp_end_ptr = NULL, *refresh_end_ptr = NULL;
>  	int i, len, ret;
>
> +	memset(mode, 0, sizeof(*mode));
>  	mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;

The reported error by kbuild rings a bell. I think I tried to do this,
saw that error, and then forgot about it.

Looking more at the code now, I don't see any in bochs that looks
really wrong. Either way, we should either fix bochs, or add a
unit-test to have a test for the bochs case so that we don't have that
issue sneaking around.

(btw, thanks for adding more tests, that's really appreciated)

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-11-18 12:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13 16:44 [PATCH v2 01/13] drm/modes: parse_cmdline: Fix possible reference past end of string Hans de Goede
2019-11-13 16:44 ` [PATCH v2 02/13] drm/modes: parse_cmdline: Make various char pointers const Hans de Goede
2019-11-13 16:44 ` [PATCH v2 03/13] drm/modes: parse_cmdline: Stop parsing extras after bpp / refresh at ', ' Hans de Goede
2019-11-13 16:44 ` [PATCH v2 04/13] drm/modes: parse_cmdline: Accept extras directly after mode combined with options Hans de Goede
2019-11-13 16:44 ` [PATCH v2 05/13] drm/modes: parse_cmdline: Rework drm_mode_parse_cmdline_options() Hans de Goede
2019-11-13 16:44 ` [PATCH v2 06/13] drm/modes: parse_cmdline: Add freestanding argument to drm_mode_parse_cmdline_options() Hans de Goede
2019-11-13 16:44 ` [PATCH v2 07/13] drm/modes: parse_cmdline: Set bpp/refresh_specified after successful parsing Hans de Goede
2019-11-13 16:44 ` [PATCH v2 08/13] drm/modes: parse_cmdline: Allow specifying stand-alone options Hans de Goede
2019-11-13 16:44 ` [PATCH v2 09/13] drm/modes: parse_cmdline: Add support for specifying panel_orientation (v2) Hans de Goede
2019-11-18 12:25   ` Maxime Ripard
2019-11-13 16:44 ` [PATCH v2 10/13] drm/modes: parse_cmdline: Remove some unnecessary code (v2) Hans de Goede
2019-11-18 12:25   ` Maxime Ripard
2019-11-13 16:44 ` [PATCH v2 11/13] drm/modes: parse_cmdline: Explicitly memset the passed in drm_cmdline_mode struct Hans de Goede
2019-11-18  8:28   ` [drm/modes] 1ea4d22f11: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2019-11-18  8:28     ` [drm/modes] 1ea4d22f11: BUG:kernel_NULL_pointer_dereference, address kernel test robot
2019-11-18  8:28     ` [drm/modes] 1ea4d22f11: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2019-11-18 12:28   ` Maxime Ripard [this message]
2019-11-18 12:33     ` [PATCH v2 11/13] drm/modes: parse_cmdline: Explicitly memset the passed in drm_cmdline_mode struct Hans de Goede
2019-11-18 12:58       ` Maxime Ripard
2019-11-18 14:26     ` Hans de Goede
2019-11-13 16:44 ` [PATCH v2 12/13] drm/connector: Split out orientation quirk detection (v2) Hans de Goede
2019-11-13 16:44 ` [PATCH v2 13/13] drm/connector: Hookup the new drm_cmdline_mode panel_orientation member Hans de Goede
2019-11-18 12:25   ` Maxime Ripard

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=20191118122816.GJ4345@gilmour.lan \
    --to=mripard@kernel.org \
    --cc=airlied@linux.ie \
    --cc=alexandretm@amotus.ca \
    --cc=daniel.vetter@intel.com \
    --cc=dbasehore@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=seanpaul@chromium.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.