Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1356967
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] kcm: fix variable type |
| Date | 2016-03-14 07:50 +0100 |
| Message-ID | <rcuue-8R-7@gated-at.bofh.it> (permalink) |
| References | <rbpdf-2ct-5@gated-at.bofh.it> <rbyqe-CG-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 03/11/2016 05:44 PM, David Miller wrote: > From: Andrzej Hajda <a.hajda@samsung.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@samsung.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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] kcm: fix variable type Andrzej Hajda <a.hajda@samsung.com> - 2016-03-11 08:00 +0100
Re: [PATCH] kcm: fix variable type David Miller <davem@davemloft.net> - 2016-03-11 17:50 +0100
Re: [PATCH] kcm: fix variable type Andrzej Hajda <a.hajda@samsung.com> - 2016-03-14 07:50 +0100
csiph-web