All of lore.kernel.org
 help / color / mirror / Atom feed
* re: scsi: iscsi: Drop suspend calls from ep_disconnect
@ 2021-06-03 22:25 Colin Ian King
  2021-06-03 23:25 ` Mike Christie
  0 siblings, 1 reply; 6+ messages in thread
From: Colin Ian King @ 2021-06-03 22:25 UTC (permalink / raw)
  To: Mike Christie; +Cc: Lee Duncan, Martin K. Petersen, linux-scsi, linux-kernel

Hi,

Static analysis on linux-next with Coverity has found an issue in
drivers/scsi/qedi/qedi_iscsi.c with the following commit:

commit 27e986289e739d08c1a4861cc3d3ec9b3a60845e
Author: Mike Christie <michael.christie@oracle.com>
Date:   Tue May 25 13:17:56 2021 -0500

    scsi: iscsi: Drop suspend calls from ep_disconnect

The analysis is as follows:

1662 void qedi_clear_session_ctx(struct iscsi_cls_session *cls_sess)
1663 {
1664        struct iscsi_session *session = cls_sess->dd_data;
1665        struct iscsi_conn *conn = session->leadconn;

    deref_ptr: Directly dereferencing pointer conn.

1666        struct qedi_conn *qedi_conn = conn->dd_data;
1667
1668        if (iscsi_is_session_online(cls_sess)) {
   Dereference before null check (REVERSE_INULL)
   check_after_deref: Null-checking conn suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.

1669                if (conn)
1670                        iscsi_suspend_queue(conn);
1671                qedi_ep_disconnect(qedi_conn->iscsi_ep);
1672        }

Pointer conn is being checked to see if it is null, but earlier it has
been dereferenced on the assignment of qedi_conn.  So either conn will
be null at some point and a null ptr dereference occurs when qedi_conn
is assigned, or conn can never be null and the conn null check is
redundant and can be removed.

Colin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-09  5:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 22:25 scsi: iscsi: Drop suspend calls from ep_disconnect Colin Ian King
2021-06-03 23:25 ` Mike Christie
2021-06-03 23:27   ` Mike Christie
2021-06-04 21:48     ` Mike Christie
2021-06-07 11:03       ` [EXT] " Manish Rangankar
2021-06-09  5:33         ` Manish Rangankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.