scst: Help Coverity recognize that vmalloc(0) returns NULL

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5603 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-06-13 23:58:28 +00:00
parent dc37ed9b4d
commit 2597448a4a
+5
View File
@@ -6470,7 +6470,12 @@ int scst_get_buf_full(struct scst_cmd *cmd, uint8_t **buf)
len = scst_get_buf_next(cmd, &tmp_buf);
}
#ifdef __COVERITY__
/* Help Coverity recognize that vmalloc(0) returns NULL. */
*buf = full_size ? vmalloc(full_size) : NULL;
#else
*buf = vmalloc(full_size);
#endif
if (*buf == NULL) {
TRACE(TRACE_OUT_OF_MEM, "vmalloc() failed for opcode "
"%s", scst_get_opcode_name(cmd));