]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: Fix static analysis warning in ib_policy_change_task
authorDaniel Jurgens <danielj@mellanox.com>
Wed, 5 Jul 2017 13:15:21 +0000 (16:15 +0300)
committerJames Morris <james.l.morris@oracle.com>
Thu, 6 Jul 2017 23:49:26 +0000 (09:49 +1000)
commit98b932043193b5ea838185255b02cac62564c75c
treed567ec6ccc997c90a20ab1cf55cc2c15efb8cd1d
parent4354d52b3382c586422399f0014a70ee6c1e1d5c
IB/core: Fix static analysis warning in ib_policy_change_task

ib_get_cached_subnet_prefix can technically fail, but the only way it
could is not possible based on the loop conditions. Check the return
value before using the variable sp to resolve a static analysis warning.

-v1:
- Fix check to !ret. Paul Moore

Fixes: 198cb760d4ad ("selinux lsm IB/core: Implement LSM notification
system")
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
drivers/infiniband/core/device.c