mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 21:26:31 +00:00
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:
+3
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user