Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1321163 > unrolled thread
| Started by | Ilia Mirkin <imirkin@alum.mit.edu> |
|---|---|
| First post | 2016-01-29 01:10 +0100 |
| Last post | 2016-01-29 04:20 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] nouveau: need to handle failed allocation Ilia Mirkin <imirkin@alum.mit.edu> - 2016-01-29 01:10 +0100
Re: [PATCH] nouveau: need to handle failed allocation Ben Skeggs <skeggsb@gmail.com> - 2016-01-29 04:20 +0100
| From | Ilia Mirkin <imirkin@alum.mit.edu> |
|---|---|
| Date | 2016-01-29 01:10 +0100 |
| Subject | Re: [PATCH] nouveau: need to handle failed allocation |
| Message-ID | <qW4Nt-2NZ-9@gated-at.bofh.it> |
On Thu, Jan 28, 2016 at 7:09 PM, Insu Yun <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> > --- > 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? > } > > int > -- > 1.9.1 >
[toc] | [next] | [standalone]
| From | Ben Skeggs <skeggsb@gmail.com> |
|---|---|
| Date | 2016-01-29 04:20 +0100 |
| Message-ID | <qW7Lj-4Yk-1@gated-at.bofh.it> |
| In reply to | #1321163 |
[Multipart message — attachments visible in raw view] — view raw
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web