scst_lib: Add a scst_put_buf_full() call in scst_block_generic_dev_done()

Avoid that Coverity complains (incorrectly) that there is a memory leak
in an error path in scst_block_generic_dev_done().


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8368 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-05-27 17:28:50 +00:00
parent dc78c5025e
commit c5d4686660
+3 -1
View File
@@ -12487,8 +12487,10 @@ int scst_block_generic_dev_done(struct scst_cmd *cmd,
buffer_size = scst_get_buf_full(cmd, &buffer);
sect_sz_off = opcode == READ_CAPACITY ? 4 : 8;
if (buffer_size < sect_sz_off + 4)
if (buffer_size < sect_sz_off + 4) {
scst_put_buf_full(cmd, buffer);
goto out;
}
sector_size = get_unaligned_be32(&buffer[sect_sz_off]);
scst_put_buf_full(cmd, buffer);
if (sector_size != 0) {