diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2020-04-15 01:02:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-15 21:33:29 +0200 |
commit | 7dba92037baf3fa00b4880a31fd532542264994c (patch) | |
tree | bb8dda947f92717171d9ad0c1ff7960c369384ad /net/rds/send.c | |
parent | net: mscc: ocelot: fix untagged packet drops when enslaving to vlan aware bridge (diff) | |
download | linux-7dba92037baf3fa00b4880a31fd532542264994c.tar.xz linux-7dba92037baf3fa00b4880a31fd532542264994c.zip |
net/rds: Use ERR_PTR for rds_message_alloc_sgs()
Returning the error code via a 'int *ret' when the function returns a
pointer is very un-kernely and causes gcc 10's static analysis to choke:
net/rds/message.c: In function ‘rds_message_map_pages’:
net/rds/message.c:358:10: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
358 | return ERR_PTR(ret);
Use a typical ERR_PTR return instead.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/send.c')
-rw-r--r-- | net/rds/send.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/rds/send.c b/net/rds/send.c index 82dcd8b84fe7..68e2bdb08fd0 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -1274,9 +1274,11 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len) /* Attach data to the rm */ if (payload_len) { - rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs, &ret); - if (!rm->data.op_sg) + rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs); + if (IS_ERR(rm->data.op_sg)) { + ret = PTR_ERR(rm->data.op_sg); goto out; + } ret = rds_message_copy_from_user(rm, &msg->msg_iter, zcopy); if (ret) goto out; |