<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 29, 2016 at 12:46 PM, One Thousand Gnomes <span dir="ltr"><<a href="mailto:gnomes@lxorguk.ukuu.org.uk" target="_blank">gnomes@lxorguk.ukuu.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, 28 Jan 2016 19:05:16 -0500<br>
Insu Yun <<a href="mailto:wuninsu@gmail.com">wuninsu@gmail.com</a>> wrote:<br>
<br>
> Since drm_property_create_range can be failed in memory pressure,<br>
> it needs to be handled.<br>
><br>
> Signed-off-by: Insu Yun <<a href="mailto:wuninsu@gmail.com">wuninsu@gmail.com</a>><br>
> ---<br>
>  drivers/gpu/drm/gma500/framebuffer.c | 2 ++<br>
>  1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c<br>
> index cb95765..31085e4 100644<br>
> --- a/drivers/gpu/drm/gma500/framebuffer.c<br>
> +++ b/drivers/gpu/drm/gma500/framebuffer.c<br>
> @@ -683,6 +683,8 @@ static int psb_create_backlight_property(struct drm_device *dev)<br>
>               return 0;<br>
><br>
>       backlight = drm_property_create_range(dev, 0, "backlight", 0, 100);<br>
> +     if (!backlight)<br>
> +             return -ENOMEM;<br>
><br>
>       dev_priv->backlight_property = backlight;<br>
><br>
<br>
</span>NAK.<br>
<br>
If we fail to create the backlight we are better off continuing than<br>
failing. The user just loses backlight control rather than having no<br>
display at all.<br>
<br>
If you check the callers you'll notice that the only caller doesn't even<br>
check the return code anyway so your patch is a no-op. If you are going<br>
to add error checking to anything with a patch please work back through<br>
the call chain and check the effect of the new error return - if any.<br>
<br>
A better patch I think would be to just eliminate the function and turn<br>
it into a tiny bit of inlined code.<br>
<br>
I'll send a patch to do that shortly.<br></blockquote><div><br></div><div>Thanks </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Alan<br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div>Regards</div>
<div>Insu Yun</div></div>
</div></div>