net/rds: Use ERR_PTR for rds_message_alloc_sgs()
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 14 Apr 2020 23:02:07 +0000 (20:02 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2020 06:20:27 +0000 (08:20 +0200)
commitab638a49a9f3ae4fcde0ca71b2a7eab87f71275b
treeb036191dd10298487920f6d2224f88042c336ec7
parentb597815ce1e8403821edc402c06da5c15da149c3
net/rds: Use ERR_PTR for rds_message_alloc_sgs()

commit 7dba92037baf3fa00b4880a31fd532542264994c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/rds/message.c
net/rds/rdma.c
net/rds/rds.h
net/rds/send.c