mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 13:16:34 +00:00
iscsi-isert: Avoid that reading the target_ip sysfs attribute triggers a kernel oops
conn->sock is set by the TCP/IP transport but not by the iSER transport. Hence check the conn->sock pointer from common code before dereferencing it. Reported-by: Doug Dumitru <doug@easyco.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8051 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -125,6 +125,9 @@ static ssize_t iscsi_get_target_ip(struct iscsi_conn *conn,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
if (!conn->sock)
|
||||
return -ENOENT;
|
||||
|
||||
sk = conn->sock->sk;
|
||||
switch (sk->sk_family) {
|
||||
case AF_INET:
|
||||
|
||||
Reference in New Issue
Block a user