From: Julia Lawall <julia.lawall@lip6.fr>
To: walter harms <wharms@bfs.de>
Cc: Mark yao <mark.yao@rock-chips.com>,
kernel-janitors@vger.kernel.org,
linux-rockchip@lists.infradead.org
Subject: Re: [PATCH] drm/rockchip: return ERR_PTR instead of NULL
Date: Fri, 11 Nov 2016 08:22:36 +0000 [thread overview]
Message-ID: <alpine.DEB.2.20.1611110921220.2074@hadrien> (raw)
In-Reply-To: <58257DA7.4020603@bfs.de>
[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]
On Fri, 11 Nov 2016, walter harms wrote:
>
>
> Am 11.11.2016 02:45, schrieb Mark yao:
> > On 2016年11月11日 05:10, Julia Lawall wrote:
> >> rockchip_drm_framebuffer_init is only used in one case, in
> >> rockchip_drm_fbdev.c, where its return value is tested using IS_ERR. To
> >> enable propagating the reason for the error, change the definition so
> >> that
> >> it returns an ERR_PTR value.
> >>
> >> Problem found with the help of Coccinelle.
> >>
> >> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > Thanks for the fix.
> >
> > Applied to my drm-next.
>
> Just for my curiosity.
>
> can more go wrong that OOM ?
Unfolding rockchip_fb_alloc suggests that a variety of error codes can be
returned, notably from the function idr_alloc.
julia
>
> i did not see that.
>
> re,
> wh
>
>
> >
> >>
> >> ---
> >> drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> >> b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> >> index 0f6eda0..01e11bf 100644
> >> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> >> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> >> @@ -213,7 +213,7 @@ struct drm_framebuffer *
> >> rockchip_fb = rockchip_fb_alloc(dev, mode_cmd, &obj, 1);
> >> if (IS_ERR(rockchip_fb))
> >> - return NULL;
> >> + return ERR_CAST(rockchip_fb);
> >> return &rockchip_fb->fb;
> >> }
> >>
> >>
> >>
> >>
> >
> >
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2016-11-11 8:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 21:10 [PATCH] drm/rockchip: return ERR_PTR instead of NULL Julia Lawall
2016-11-11 1:45 ` Mark yao
2016-11-11 8:13 ` walter harms
2016-11-11 8:22 ` Julia Lawall [this message]
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=alpine.DEB.2.20.1611110921220.2074@hadrien \
--to=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mark.yao@rock-chips.com \
--cc=wharms@bfs.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox