]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/cma: fix null-ptr-deref Read in cma_cleanup
authorzhengbin <zhengbin13@huawei.com>
Mon, 19 Aug 2019 04:27:39 +0000 (12:27 +0800)
committerDoug Ledford <dledford@redhat.com>
Tue, 20 Aug 2019 17:44:45 +0000 (13:44 -0400)
commit2c3e561e5e6a4863f5f93748849f17344c77d803
treeb5a930880d54241b3e4a05bef6bb5f4f17d43b36
parentb0f56d0499a8ea56d2261c9f04a619e1b6d77ad2
RDMA/cma: fix null-ptr-deref Read in cma_cleanup

In cma_init, if cma_configfs_init fails, need to free the
previously memory and return fail, otherwise will trigger
null-ptr-deref Read in cma_cleanup.

cma_cleanup
  cma_configfs_exit
    configfs_unregister_subsystem

Fixes: b168a25da509 ("IB/cma: Add configfs for rdma_cm")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Link: https://lore.kernel.org/r/1566188859-103051-1-git-send-email-zhengbin13@huawei.com
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cma.c