[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <56E65E18.1050907@samsung.com>
Date: Mon, 14 Mar 2016 07:45:44 +0100
From: Andrzej Hajda <a.hajda@...sung.com>
To: David Miller <davem@...emloft.net>
Cc: tom@...bertland.com, b.zolnierkie@...sung.com,
m.szyprowski@...sung.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kcm: fix variable type
On 03/11/2016 05:44 PM, David Miller wrote:
> From: Andrzej Hajda <a.hajda@...sung.com>
> Date: Fri, 11 Mar 2016 07:51:15 +0100
>
>> Function skb_splice_bits can return negative values, its result should
>> be assigned to signed variable to allow correct error checking.
>>
>> The problem has been detected using patch
>> scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci.
>>
>> Signed-off-by: Andrzej Hajda <a.hajda@...sung.com>
> Since skb_splice_bits() returns an 'int', that would be a more appropriate
> type to use here.
>
> Thank you.
>
>
On the other side kcm_splice_read use this local var as return variable,
and the return type is ssize_t.
Digging deeper it looks like:
ssize_t kcm_splice_read(...) returns result of
int skb_splice_bits(...) which returns result of
ssize_t splice_cb(...) callback.
It looks code is somehow inconsistent, but maybe there are other reasons
which I am not aware of.
Regards
Andrzej
Powered by blists - more mailing lists