lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 16 Jan 2015 14:31:54 +0100 From: Nicolas Dichtel <nicolas.dichtel@...nd.com> To: Al Viro <viro@...IV.linux.org.uk> CC: netdev@...r.kernel.org, davem@...emloft.net Subject: Re: [PATCH net-next] socket: use iov_length() Le 15/01/2015 22:45, Al Viro a écrit : > On Wed, Jan 14, 2015 at 11:07:50AM +0100, Nicolas Dichtel wrote: >> Better to use available helpers. >> >> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.com> >> --- >> net/socket.c | 8 ++------ >> 1 file changed, 2 insertions(+), 6 deletions(-) >> >> diff --git a/net/socket.c b/net/socket.c >> index a2c33a4dc7ba..b1f3fa4da020 100644 >> --- a/net/socket.c >> +++ b/net/socket.c >> @@ -883,10 +883,8 @@ static ssize_t do_sock_read(struct msghdr *msg, struct kiocb *iocb, >> { >> struct socket *sock = file->private_data; >> size_t size = 0; >> - int i; >> >> - for (i = 0; i < nr_segs; i++) >> - size += iov[i].iov_len; >> + size = iov_length(iov, nr_segs); > > What's wrong with size = iocb->ki_nbytes instead of calling anything? > I'm not an expert, but it seems you're right. I will send a patch. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists