Avoid that the following error is reported when building SCST against
a Linux kernel older than v4.18 combined with MOFED >= 4.5:
scst/include/backport.h:910:21: error: redefinition of 'kvcalloc'
static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
^
In file included from ./include/linux/highmem.h:8:0,
from ./include/linux/bio.h:21,
from ./scst/include/backport.h:24,
from ./scst/include/scst_debug.h:42,
from isert-scst/isert_dbg.h:29,
from isert-scst/iser_global.c:40:
/usr/src/ofa_kernel/default/include/linux/mm.h:78:21: note: previous definition of 'kvcalloc' was here
static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
^
Signed-off-by: Sergey Gorenko <sergeygo@mellanox.com>
[bvanassche: renamed MOFED_*_VERSION INTO MOFED_*]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8398 d57e44dd-8a1f-0410-8b47-8ef2f437770f
When building against Oracle Linux + MOFED the build fails unless if
DTrace is disabled. Hence disable DTrace for the isert-scst module if
MOFED is detected.
Signed-off-by: Sergey Gorenko <sergeygo@mellanox.com>
[ bvanassche: Left out one empty OFED_CONFIG assignment ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8396 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Use grep to check whether or not 'git tag' succeeded since the exit status
of 'git tag' is always zero.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8395 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since qlt_remove_target() only calls qlt_release() if
vha->vha_tgt.qla_tgt != NULL, checking that pointer inside qlt_release()
is not necessary. This patch avoids that Coverity reports the following:
CID 188348 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer &vha->vha_tgt.qla_tgt->tgt_list_entry
to list_del, which dereferences it.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8394 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Return a QLA_* status code instead of returning a pointer. This patch does
not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8391 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch avoids that Coverity complains that the return value of
qla2x00_wait_for_hba_online() is not always checked.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8381 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch avoids that Coverity reports the following:
Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression dma_eng_num *
65536U with type unsigned int (32 bits, unsigned) is evaluated using 32-bit
arithmetic, and then used in a context that expects an expression of type
uint64_t (64 bits, unsigned).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8379 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Set the r??_data_len variables before using these instead of after.
This patch avoids that Coverity reports the following:
const: At condition req_data_len != rsp_data_len, the value of req_data_len must be equal to 0.
const: At condition req_data_len != rsp_data_len, the value of rsp_data_len must be equal to 0.
dead_error_condition: The condition req_data_len != rsp_data_len cannot be true.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch avoids that Coverity reports the following:
Unchecked return value (CHECKED_RETURN)34. check_return: Calling
atomic_read without checking return value (as is done elsewhere 80 out
of 92 times).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8376 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since sess == NULL before 'goto out_term2' is executed, the code under
'if (sess)' cannot be reached. Hence remove that code. This was detected
by Coverity.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8375 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Checking a pointer after it has been dereferenced is not useful. This was
detected by Coverity.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8374 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch avoids that Coverity reports the following:
Unchecked return value (CHECKED_RETURN)16. check_return: Calling
wait_for_completion_timeout without checking return value (as is done
elsewhere 14 out of 17 times).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8372 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch avoids that Coverity reports the following:
Null-checking sp->u.iocb_cmd.u.ctarg.rsp suggests that it may be null, but
it has already been dereferenced on all paths leading to the check.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8371 d57e44dd-8a1f-0410-8b47-8ef2f437770f
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 patch avoids that sparse complains about local symbols not having been
declared 'static'.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8367 d57e44dd-8a1f-0410-8b47-8ef2f437770f
During EEH error recovery testing it was discovered that driver's reset()
callback partially frees resources used by driver, leaving some stale
memory. After reset() is done and when resume() callback in driver uses
old data which results into error leaving adapter disabled due to PCIe
error.
This patch does cleanup for EEH recovery code path and prevents adapter
from getting disabled.
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ bvanassche: Ported from upstream kernel to SCST ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8365 d57e44dd-8a1f-0410-8b47-8ef2f437770f