All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: intel-gfx@lists.freedesktop.org,
	ML dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 1/3] drm: Don't create properties without names
Date: Tue, 6 Mar 2018 15:54:44 +0200	[thread overview]
Message-ID: <20180306135444.GH5453@intel.com> (raw)
In-Reply-To: <CACvgo50M6Z_TzuKFHE9HRWCa5TOwY3gj8i2cOPBQUh7EDJ7KvA@mail.gmail.com>

On Tue, Mar 06, 2018 at 01:35:11PM +0000, Emil Velikov wrote:
> Hi Ville,
> 
> On 2 March 2018 at 13:25, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Creating a property that doesn't have a name makes no sense to me. Don't
> > allow it.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/drm_property.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c
> > index bae50e6b819d..fe8627fb7ae6 100644
> > --- a/drivers/gpu/drm/drm_property.c
> > +++ b/drivers/gpu/drm/drm_property.c
> > @@ -99,10 +99,8 @@ struct drm_property *drm_property_create(struct drm_device *dev, int flags,
> >         property->num_values = num_values;
> >         INIT_LIST_HEAD(&property->enum_list);
> >
> > -       if (name) {
> > -               strncpy(property->name, name, DRM_PROP_NAME_LEN);
> > -               property->name[DRM_PROP_NAME_LEN-1] = '\0';
> > -       }
> > +       strncpy(property->name, name, DRM_PROP_NAME_LEN);
> > +       property->name[DRM_PROP_NAME_LEN-1] = '\0';
> >
> Shouldn't one also a) error (WARN + return NULL) out when name is NULL
> and b) update the documentation?

The developer gets the oops. No point in further handholding IMO.

Didn't look at the docs us usual. Are they saying NULL is OK?

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-03-06 13:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02 13:25 [PATCH 1/3] drm: Don't create properties without names Ville Syrjala
2018-03-02 13:25 ` [PATCH 2/3] drm: Check property/enum name length Ville Syrjala
2018-03-02 14:03   ` [PATCH v2 2/3 " Ville Syrjala
2018-03-06 10:22     ` [Intel-gfx] " Daniel Vetter
2018-03-06 11:50       ` Ville Syrjälä
2018-03-02 13:25 ` [PATCH v2 3/3] drm: Add BT.2020 constant luminance enum value for the COLOR_ENCODING property Ville Syrjala
2018-03-02 13:58 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/3] drm: Don't create properties without names Patchwork
2018-03-02 14:13 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-02 14:55 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm: Don't create properties without names (rev2) Patchwork
2018-03-02 16:59 ` ✓ Fi.CI.IGT: " Patchwork
2018-03-06 10:18 ` [PATCH 1/3] drm: Don't create properties without names Daniel Vetter
2018-03-06 13:35 ` [Intel-gfx] " Emil Velikov
2018-03-06 13:54   ` Ville Syrjälä [this message]
2018-03-06 15:41     ` Emil Velikov

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=20180306135444.GH5453@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=intel-gfx@lists.freedesktop.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.