]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: fix invalid return code in smcd_new_buf_create()
authorKarsten Graul <kgraul@linux.ibm.com>
Wed, 14 Oct 2020 17:43:29 +0000 (19:43 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 15 Oct 2020 16:54:43 +0000 (09:54 -0700)
commit8cc5b24941b5b85762800fddc8432336cde78aeb
tree71b0f3f664252ab57d21661c989a399fc8889193
parent8d59774a76e93b2cfb1a098116678ee5b3da4eeb
net/smc: fix invalid return code in smcd_new_buf_create()

smc_ism_register_dmb() returns error codes set by the ISM driver which
are not guaranteed to be negative or in the errno range. Such values
would not be handled by ERR_PTR() and finally the return code will be
used as a memory address.
Fix that by using a valid negative errno value with ERR_PTR().

Fixes: b023aaa47bb5 ("net/smc: unique reason code for exceeded max dmb count")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/smc_core.c