[PATCH] net/socket: Remove unnecessary ‘0’ values from used

From: Li zeming
Date: Thu Aug 31 2023 - 21:51:35 EST


used is assigned first, so it does not need to initialize the
assignment.

Signed-off-by: Li zeming <zeming@xxxxxxxxxxxx>
---
net/socket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index 2b0e54b2405c..743e54eba06f 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -569,12 +569,12 @@ static ssize_t sockfs_listxattr(struct dentry *dentry, char *buffer,
size_t size)
{
ssize_t len;
- ssize_t used = 0;
+ ssize_t used;

len = security_inode_listsecurity(d_inode(dentry), buffer, size);
if (len < 0)
return len;
- used += len;
+ used = len;
if (buffer) {
if (size < used)
return -ERANGE;
--
2.18.2