diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c b/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c index 0cf015634338af8aafaf796d5ce011d3dc517597..3d7877534bcc9d9cc33ab6f6605598ee3435d07b 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c @@ -189,6 +189,7 @@ static int rtrs_srv_create_once_sysfs_root_folders(struct rtrs_srv_sess *sess) } srv->kobj_paths = kobject_create_and_add("paths", &srv->dev.kobj); if (!srv->kobj_paths) { + err = -ENOMEM; pr_err("kobject_create_and_add(): %d\n", err); device_unregister(&srv->dev); goto unlock; diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c index 863b3942e3332d491d748247b36a9bfd795c77f3..1fc6ece036ff2ee4aef7cf07d2de5dbf6ce03b39 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c @@ -660,8 +660,8 @@ static int map_cont_bufs(struct rtrs_srv_sess *sess) GFP_KERNEL, sess->s.dev->ib_dev, DMA_TO_DEVICE, rtrs_srv_rdma_done); if (!srv_mr->iu) { - rtrs_err(ss, "rtrs_iu_alloc(), err: %d\n", - -ENOMEM); + err = -ENOMEM; + rtrs_err(ss, "rtrs_iu_alloc(), err: %d\n", err); goto free_iu; } } @@ -2150,8 +2150,10 @@ static int __init rtrs_server_init(void) goto out_chunk_pool; } rtrs_wq = alloc_workqueue("rtrs_server_wq", WQ_MEM_RECLAIM, 0); - if (!rtrs_wq) + if (!rtrs_wq) { + err = -ENOMEM; goto out_dev_class; + } return 0;