Minor misc changes

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7068 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2016-12-20 05:55:19 +00:00
parent bb2f47e7a8
commit df55eeb5da
6 changed files with 23 additions and 2 deletions

View File

@@ -459,6 +459,14 @@ void cmnd_done(struct iscsi_cmnd *cmnd)
/* Order between above and below code is important! */
if ((cmnd->scst_cmd != NULL) || (cmnd->scst_aen != NULL)) {
/*
* Tell Coverity when cmnd->scst_cmd or scst_aen is set.
*/
if (cmnd->scst_state == ISCSI_CMD_STATE_AEN)
EXTRACHECKS_BUG_ON(!cmnd->scst_aen);
else
EXTRACHECKS_BUG_ON(!cmnd->scst_cmd);
switch (cmnd->scst_state) {
case ISCSI_CMD_STATE_PROCESSED:
TRACE_DBG("cmd %p PROCESSED", cmnd);

View File

@@ -335,13 +335,15 @@ enum umh_wait {
LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 41)) && \
! (LINUX_VERSION_CODE >> 8 == KERNEL_VERSION(3, 2, 0) >> 8 && \
LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 44)) && \
!defined(CONFIG_SUSE_KERNEL) && \
(!defined(CONFIG_SUSE_KERNEL) || \
LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 101)) && \
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6 || \
(RHEL_MAJOR -0 == 6 && RHEL_MINOR -0 < 6))
/*
* See also commit 4b20db3 (kref: Implement kref_get_unless_zero v3 -- v3.8).
* See also commit e3a5505 in branch stable/linux-3.4.y (v3.4.41).
* See also commit 3fa8ee5 in branch stable/linux-3.2.y (v3.2.44).
* See also commit 6b9508d in the SuSE kernel tree.
*/
static inline int __must_check kref_get_unless_zero(struct kref *kref)
{

View File

@@ -1828,6 +1828,14 @@ static int dev_user_process_reply_exec(struct scst_user_cmd *ucmd,
scst_set_resp_data_len(cmd, ereply->resp_data_len);
}
#ifdef CONFIG_SCST_EXTRACHECKS
if (unlikely((ereply->resp_data_len == 0) && (ereply->pbuf != 0))) {
PRINT_WARNING("Supplied pbuf 0x%llx ignored, because "
"resp_data_len is 0. Memory leak? (op %s)",
(unsigned long long)ereply->pbuf, scst_get_opcode_name(cmd));
}
#endif
cmd->status = ereply->status;
if (ereply->sense_len != 0) {
int sense_len, rc;

View File

@@ -3429,7 +3429,9 @@ enomem:
TRACE_EXIT_RES(-ENOMEM);
return scst_get_cmd_abnormal_done_state(cmd);
}
#else
static int fileio_alloc_data_buf(struct scst_cmd *cmd)
{
struct vdisk_cmd_params *p;
@@ -3447,6 +3449,7 @@ static int fileio_alloc_data_buf(struct scst_cmd *cmd)
static void finish_read(struct scatterlist *sg, int sg_cnt)
{
}
#endif
static int vdev_do_job(struct scst_cmd *cmd, const vdisk_op_fn *ops)

View File

@@ -6709,7 +6709,6 @@ out_done:
goto out;
}
int scst_finish_internal_cmd(struct scst_cmd *cmd)
{
int res;

View File

@@ -2835,6 +2835,7 @@ static void __exit exit_scst(void)
scst_deinit_threads(&scst_main_cmd_threads);
scsi_unregister_interface(&scst_interface);
#ifdef CONFIG_SCST_PROC
scst_del_free_acg(scst_default_acg, false);
#endif