kpartx: Improve reliability of find_loop_by_file()
authorBart Van Assche <bart.vanassche@wdc.com>
Wed, 7 Mar 2018 23:15:47 +0000 (00:15 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sat, 10 Mar 2018 07:23:00 +0000 (08:23 +0100)
commit3d2f08969f88050d95bd02e0a1c0f8eeba9f1526
treec6851d489b8cd4c3f2d7dce361cf640ae42922c0
parentb0c9d7a92c93c2e562d62a11395a4a265dccb295
kpartx: Improve reliability of find_loop_by_file()

Avoid that the strchr() call in this function examines uninitialized
data on the stack. This patch avoids that Coverity reports the following:

    CID 173252:  Error handling issues  (CHECKED_RETURN)
    "read(int, void *, size_t)" returns the number of bytes read, but it is ignored.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
kpartx/lopart.c