lkml.org 
[lkml]   [2016]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: linux-4.6/net/kcm/kcmsock.c:1508: bad if test ?
On Mon, May 16, 2016 at 11:40 AM, David Binderman
<linuxdev.baldrick@gmail.com> wrote:
> Hello there,
>
> linux-4.6/net/kcm/kcmsock.c:1508]: (style) Checking if unsigned
> variable 'copied' is less than zero.
>
> Source code is
>
> if (copied < 0) {
>
> but
>
> size_t copied;
>
> Suggest code rework.

Thanks for the report! I think the following patch is enough:

diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 40662d73..8bfc390 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1483,7 +1483,7 @@ static ssize_t kcm_splice_read(struct socket
*sock, loff_t *ppos,
long timeo;
struct kcm_rx_msg *rxm;
int err = 0;
- size_t copied;
+ int copied;
struct sk_buff *skb;

/* Only support splice for SOCKSEQPACKET */
\
 
 \ /
  Last update: 2016-05-17 18:21    [W:0.040 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site