Re: [RFC PATCH] libmultipath: is_path_valid(): check if device is in use

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

 



On Thu, 2022-11-17 at 21:40 +0100, Martin Wilck wrote:
> > 
> > > +       pthread_cleanup_push_cast(free_scandir_result, &sr);
> > > +
> > > +       /* parts[0] is the whole disk */
> > > +       if (vector_alloc_slot(parts) &&
> > > +           (prop = strdup(strrchr(path, '/') + 1)) != NULL)
> > 
> > Since we always add 1, prop can never be NULL.
> 
> Oops. I should rather check for prop != ONE then :-)

... or rather not. 
The "+ 1" is inside the parentheses of the call to strdup().

Regards
Martin

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/dm-devel





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux