From: walter harms <wharms@bfs.de>
To: Mark yao <mark.yao@rock-chips.com>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>,
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:13:27 +0000 [thread overview]
Message-ID: <58257DA7.4020603@bfs.de> (raw)
In-Reply-To: <5825229C.8080704@rock-chips.com>
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 ?
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;
>> }
>>
>>
>>
>>
>
>
next prev parent reply other threads:[~2016-11-11 8:13 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 [this message]
2016-11-11 8:22 ` Julia Lawall
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=58257DA7.4020603@bfs.de \
--to=wharms@bfs.de \
--cc=Julia.Lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mark.yao@rock-chips.com \
/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