summaryrefslogtreecommitdiffstats
path: root/net/rds/rds.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2020-04-14 20:02:07 -0300
committerDavid S. Miller <davem@davemloft.net>2020-04-15 12:33:29 -0700
commit7dba92037baf3fa00b4880a31fd532542264994c (patch)
treebb8dda947f92717171d9ad0c1ff7960c369384ad /net/rds/rds.h
parent87b0f983f66f23762921129fd35966eddc3f2dae (diff)
downloadlinux-7dba92037baf3fa00b4880a31fd532542264994c.tar.gz
linux-7dba92037baf3fa00b4880a31fd532542264994c.tar.bz2
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/rds.h')
-rw-r--r--net/rds/rds.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 8e18cd2aec51..6019b0c004a9 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -844,8 +844,7 @@ rds_conn_connecting(struct rds_connection *conn)
/* message.c */
struct rds_message *rds_message_alloc(unsigned int nents, gfp_t gfp);
-struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents,
- int *ret);
+struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents);
int rds_message_copy_from_user(struct rds_message *rm, struct iov_iter *from,
bool zcopy);
struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned int total_len);