From cb595a5a13134cd3c12559e5e3b69f4ecf667c18 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 22 Jan 2014 16:20:09 +0100 Subject: [PATCH] coverity: check return value of dev_close in dev_get_block_size() --- lib/device/dev-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c index 82cc2fc26..669745639 100644 --- a/lib/device/dev-io.c +++ b/lib/device/dev-io.c @@ -178,8 +178,8 @@ int dev_get_block_size(struct device *dev, unsigned int *physical_block_size, un *physical_block_size = (unsigned int) dev->phys_block_size; *block_size = (unsigned int) dev->block_size; out: - if (needs_open) - dev_close(dev); + if (needs_open && !dev_close(dev)) + stack; return r; }