]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Apr 2020 19:33:29 +0000 (12:33 -0700)
commite0838d5351e005b9ed56246c2c8fd359ed424def
treebb8dda947f92717171d9ad0c1ff7960c369384ad
parent7959c264b1a70636a0cfbd4acc56c6e52a4b0578
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>
net/rds/message.c
net/rds/rdma.c
net/rds/rds.h
net/rds/send.c