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