[PATCH] cxgb4i: Fix neigh entry leak
When csk-atid returned by cxgb4_alloc_atid() is less than zero, init_act_open() directly returns with -EINVAL. But as init_act_open() ever invokes dst_neigh_lookup() before it calls cxgb4_alloc_atid(), this leads to the leak of neigh entry searched by dst_neigh_lookup(). Signed-off-by: Ying Xue ying@windriver.com --- drivers/scsi/cxgbi/cxgb4i/cxgb4i.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c index dd00e5f..c449d2a 100644 --- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c @@ -1393,7 +1393,7 @@ static int init_act_open(struct cxgbi_sock *csk) csk-atid = cxgb4_alloc_atid(lldi-tids, csk); if (csk-atid 0) { pr_err(%s, NO atid available.\n, ndev-name); - return -EINVAL; + goto rel_resource; } cxgbi_sock_set_flag(csk, CTPF_HAS_ATID); cxgbi_sock_get(csk); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] iscsi: Don't disable BH on BH context
Michael Christie wrote: On Aug 20, 2012, at 8:28 PM, Ying Xue ying@windriver.com wrote: Since we have already in BH context when iscsi_sw_tcp_write_space() is called, it's unnecessary to disable BH. Hey, I do don't think this is right anymore. It looks like it can be called in sock_setsockopt. I just finds it seems this is an unnecessary action to disable BH on BH context when I look through iscsi code. If you can confirm the iscsi_sw_tcp_write_space() is also called in process context, please ignore the noise. Regards, Ying Signed-off-by: Ying Xue ying@windriver.com Acked-by: Michael Christie micha...@cs.wisc.edu --- drivers/scsi/iscsi_tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 9220861..d763857 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c @@ -194,7 +194,7 @@ static void iscsi_sw_tcp_write_space(struct sock *sk) struct iscsi_sw_tcp_conn *tcp_sw_conn; void (*old_write_space)(struct sock *); - read_lock_bh(sk-sk_callback_lock); + read_lock(sk-sk_callback_lock); conn = sk-sk_user_data; if (!conn) { read_unlock_bh(sk-sk_callback_lock); @@ -204,7 +204,7 @@ static void iscsi_sw_tcp_write_space(struct sock *sk) tcp_conn = conn-dd_data; tcp_sw_conn = tcp_conn-dd_data; old_write_space = tcp_sw_conn-old_write_space; - read_unlock_bh(sk-sk_callback_lock); + read_unlock(sk-sk_callback_lock); old_write_space(sk); -- 1.7.11 -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] iscsi: Don't disable BH on BH context
Since we have already in BH context when iscsi_sw_tcp_write_space() is called, it's unnecessary to disable BH. Signed-off-by: Ying Xue ying@windriver.com Acked-by: Michael Christie micha...@cs.wisc.edu --- drivers/scsi/iscsi_tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 9220861..d763857 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c @@ -194,7 +194,7 @@ static void iscsi_sw_tcp_write_space(struct sock *sk) struct iscsi_sw_tcp_conn *tcp_sw_conn; void (*old_write_space)(struct sock *); - read_lock_bh(sk-sk_callback_lock); + read_lock(sk-sk_callback_lock); conn = sk-sk_user_data; if (!conn) { read_unlock_bh(sk-sk_callback_lock); @@ -204,7 +204,7 @@ static void iscsi_sw_tcp_write_space(struct sock *sk) tcp_conn = conn-dd_data; tcp_sw_conn = tcp_conn-dd_data; old_write_space = tcp_sw_conn-old_write_space; - read_unlock_bh(sk-sk_callback_lock); + read_unlock(sk-sk_callback_lock); old_write_space(sk); -- 1.7.11 -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html