[PATCH v3 3/4] drivers: lustre: ldlm: check result of register_shrinker()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ldlm_pools_init() does not check result of register_shrinker()
which was tagged __must_check recently, reported by sparse.

Signed-off-by: Aliaksei Karaliou <akaraliou.dev@xxxxxxxxx>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

v3: Style fixes, as suggested by Andreas Cheers, Dan Carpenter and Greg KH.

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index da65d00a7811..8563bd32befa 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -1086,8 +1086,12 @@ int ldlm_pools_init(void)
 	int rc;
 
 	rc = ldlm_pools_thread_start();
-	if (rc == 0)
-		register_shrinker(&ldlm_pools_cli_shrinker);
+	if (rc)
+		return rc;
+
+	rc = register_shrinker(&ldlm_pools_cli_shrinker);
+	if (rc)
+		ldlm_pools_thread_stop();
 
 	return rc;
 }
-- 
2.11.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux