]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - sg_io.c
Assemble: print error message if mdadm fails assembling with --uuid option
[thirdparty/mdadm.git] / sg_io.c
diff --git a/sg_io.c b/sg_io.c
index 42c91e1e9c6be4deb7a96d7a78c0c29dd9aaaa01..7889a95ecae4dbead43c1e1b866277152924ca49 100644 (file)
--- a/sg_io.c
+++ b/sg_io.c
@@ -46,6 +46,9 @@ int scsi_get_serial(int fd, void *buf, size_t buf_len)
        if (rv)
                return rv;
 
+       if ((io_hdr.info & SG_INFO_OK_MASK) != SG_INFO_OK)
+               return -1;
+
        rsp_len = rsp_buf[3];
 
        if (!rsp_len || buf_len < rsp_len)