From: Ben Skeggs <skeggsb@gmail.com>
To: Insu Yun <wuninsu@gmail.com>, Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Yeongjin Jang <yeongjin.jang@gatech.edu>,
Taesoo Kim <taesoo@gatech.edu>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
"Yun, Insu" <insu@gatech.edu>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Thierry Reding <treding@nvidia.com>,
Changwoo Min <changwoo@gatech.edu>
Subject: Re: [PATCH] nouveau: need to handle failed allocation
Date: Fri, 29 Jan 2016 13:18:26 +1000 [thread overview]
Message-ID: <56AADA02.9040900@gmail.com> (raw)
In-Reply-To: <CAGoFzNfPCQqVsGK_pVaBPFTSuCKe0Qc-eSuN1Y78hWiHbgU0vg@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2069 bytes --]
On 01/29/2016 10:12 AM, Insu Yun wrote:
>
> On Thu, Jan 28, 2016 at 7:08 PM, Ilia Mirkin <imirkin@alum.mit.edu
> <mailto:imirkin@alum.mit.edu>> wrote:
>
> On Thu, Jan 28, 2016 at 7:09 PM, Insu Yun <wuninsu@gmail.com
> <mailto:wuninsu@gmail.com>> wrote:
> > drm_property_create_range can be failed in memory pressure.
> > So, it needs to be handled.
> >
> > Signed-off-by: Insu Yun <wuninsu@gmail.com <mailto:wuninsu@gmail.com>>
> > ---
> > drivers/gpu/drm/nouveau/nouveau_display.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
> > index 24be27d..26b4902 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_display.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_display.c
> > @@ -443,6 +443,12 @@ nouveau_display_create_properties(struct drm_device *dev)
> > /* -100..+100 */
> > disp->color_vibrance_property =
> > drm_property_create_range(dev, 0, "color vibrance", 0, 200);
> > +
> > + if (!disp->underscan_hborder_property ||
> > + !disp->underscan_vborder_property ||
> > + !disp->vibrant_hue_property ||
> > + !disp->color_vibrance_property)
> > + return;
>
> Aren't we at the end of the function anyways?
>
>
> Sorry. it is not perfect patch
> I found this by my static analyzer.
> I have limited knowledge about this driver.
> I don't want to mass up your driver.
> What I want to do is to tell you there is a bug.
> I think we need to return error to caller.
I'm not so sure we do. We check for valid pointers for these when
they're actually used, so no OOPS will occur. Worst case, the driver
still loads correctly with some missing properties.
Ben.
>
>
>
> > }
> >
> > int
> > --
> > 1.9.1
> >
>
>
>
>
> --
> Regards
> Insu Yun
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Ben Skeggs <skeggsb@gmail.com>
To: Insu Yun <wuninsu@gmail.com>, Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel.vetter@ffwll.ch>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
maarten.lankhorst@linux.intel.com,
"Thierry Reding" <treding@nvidia.com>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Taesoo Kim" <taesoo@gatech.edu>,
"Yeongjin Jang" <yeongjin.jang@gatech.edu>,
"Yun, Insu" <insu@gatech.edu>,
"Changwoo Min" <changwoo@gatech.edu>
Subject: Re: [PATCH] nouveau: need to handle failed allocation
Date: Fri, 29 Jan 2016 13:18:26 +1000 [thread overview]
Message-ID: <56AADA02.9040900@gmail.com> (raw)
In-Reply-To: <CAGoFzNfPCQqVsGK_pVaBPFTSuCKe0Qc-eSuN1Y78hWiHbgU0vg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2069 bytes --]
On 01/29/2016 10:12 AM, Insu Yun wrote:
>
> On Thu, Jan 28, 2016 at 7:08 PM, Ilia Mirkin <imirkin@alum.mit.edu
> <mailto:imirkin@alum.mit.edu>> wrote:
>
> On Thu, Jan 28, 2016 at 7:09 PM, Insu Yun <wuninsu@gmail.com
> <mailto:wuninsu@gmail.com>> wrote:
> > drm_property_create_range can be failed in memory pressure.
> > So, it needs to be handled.
> >
> > Signed-off-by: Insu Yun <wuninsu@gmail.com <mailto:wuninsu@gmail.com>>
> > ---
> > drivers/gpu/drm/nouveau/nouveau_display.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
> > index 24be27d..26b4902 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_display.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_display.c
> > @@ -443,6 +443,12 @@ nouveau_display_create_properties(struct drm_device *dev)
> > /* -100..+100 */
> > disp->color_vibrance_property =
> > drm_property_create_range(dev, 0, "color vibrance", 0, 200);
> > +
> > + if (!disp->underscan_hborder_property ||
> > + !disp->underscan_vborder_property ||
> > + !disp->vibrant_hue_property ||
> > + !disp->color_vibrance_property)
> > + return;
>
> Aren't we at the end of the function anyways?
>
>
> Sorry. it is not perfect patch
> I found this by my static analyzer.
> I have limited knowledge about this driver.
> I don't want to mass up your driver.
> What I want to do is to tell you there is a bug.
> I think we need to return error to caller.
I'm not so sure we do. We check for valid pointers for these when
they're actually used, so no OOPS will occur. Worst case, the driver
still loads correctly with some missing properties.
Ben.
>
>
>
> > }
> >
> > int
> > --
> > 1.9.1
> >
>
>
>
>
> --
> Regards
> Insu Yun
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-01-29 3:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 0:09 [PATCH] nouveau: need to handle failed allocation Insu Yun
2016-01-29 0:08 ` Ilia Mirkin
2016-01-29 0:08 ` Ilia Mirkin
2016-01-29 0:12 ` Insu Yun
2016-01-29 3:18 ` Ben Skeggs [this message]
2016-01-29 3:18 ` Ben Skeggs
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=56AADA02.9040900@gmail.com \
--to=skeggsb@gmail.com \
--cc=changwoo@gatech.edu \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=imirkin@alum.mit.edu \
--cc=insu@gatech.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=taesoo@gatech.edu \
--cc=treding@nvidia.com \
--cc=wuninsu@gmail.com \
--cc=yeongjin.jang@gatech.edu \
/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.