Skip to content

Commit

Permalink
fixup "libmultipath: use libmp_pathinfo() in update_multipath_table()"
Browse files Browse the repository at this point in the history
We need to check for NULL before dereferencing mpp.
Found by coverity.

Signed-off-by: Martin Wilck <[email protected]>
  • Loading branch information
mwilck committed Jul 18, 2024
1 parent c92467e commit 2705373
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libmultipath/structs_vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,12 @@ update_multipath_table (struct multipath *mpp, vector pathvec, int flags)
int r = DMP_ERR;
char __attribute__((cleanup(cleanup_charp))) *params = NULL;
char __attribute__((cleanup(cleanup_charp))) *status = NULL;
unsigned long long size = mpp->size;
unsigned long long size;

if (!mpp)
return r;

size = mpp->size;
r = libmp_mapinfo(DM_MAP_BY_NAME | MAPINFO_MPATH_ONLY,
(mapid_t) { .str = mpp->alias },
(mapinfo_t) {
Expand Down

0 comments on commit 2705373

Please sign in to comment.