mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 12:11:26 +00:00
scst_mem: Check for errors in scst_sgv_pools_init()
The register_shrinker() function may return an error since Linux kernel v3.12.
This commit is contained in:
@@ -1798,7 +1798,10 @@ int scst_sgv_pools_init(unsigned long mem_hwmark, unsigned long mem_lwmark)
|
||||
sgv_shrinker.shrink = sgv_shrink;
|
||||
#endif
|
||||
sgv_shrinker.seeks = DEFAULT_SEEKS;
|
||||
register_shrinker(&sgv_shrinker, "scst-sgv");
|
||||
|
||||
res = register_shrinker(&sgv_shrinker, "scst-sgv");
|
||||
if (unlikely(res))
|
||||
goto out_free_per_cpu_dma;
|
||||
|
||||
out:
|
||||
TRACE_EXIT_RES(res);
|
||||
@@ -1828,7 +1831,7 @@ out_free_pool:
|
||||
kmem_cache_destroy(sgv_pool_cachep);
|
||||
|
||||
out_err:
|
||||
res = -ENOMEM;
|
||||
res = res ?: -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user