mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cov: validate dev_get_primary_dev result
Make sure primary_dev is defined when using it.
This commit is contained in:
parent
0cc5c2203b
commit
7b52a663a6
@ -688,7 +688,8 @@ int dev_is_mpath_component(struct cmd_context *cmd, struct device *dev, dev_t *h
|
|||||||
* primary_result 2: dev is a partition, primary_dev is the whole device
|
* primary_result 2: dev is a partition, primary_dev is the whole device
|
||||||
* primary_result 1: dev is a whole device
|
* primary_result 1: dev is a whole device
|
||||||
*/
|
*/
|
||||||
primary_result = dev_get_primary_dev(dt, dev, &primary_dev);
|
if (!(primary_result = dev_get_primary_dev(dt, dev, &primary_dev)))
|
||||||
|
return_0;
|
||||||
|
|
||||||
if (_dev_is_mpath_component_sysfs(cmd, dev, primary_result, primary_dev, holder_devno) == 1)
|
if (_dev_is_mpath_component_sysfs(cmd, dev, primary_result, primary_dev, holder_devno) == 1)
|
||||||
goto found;
|
goto found;
|
||||||
|
Loading…
Reference in New Issue
Block a user