On Wed, 2010-10-27 at 20:40 +0800, Hillf Danton wrote:
> There seems info should get freed when error encountered.
> 
> Signed-off-by: Hillf Danton <[email protected]>
> ---
> 
> --- a/drivers/scsi/libfc/fc_lport.c   2010-09-13 07:07:38.000000000 +0800
> +++ b/drivers/scsi/libfc/fc_lport.c   2010-10-27 20:33:36.000000000 +0800
> @@ -1766,8 +1766,10 @@ static int fc_lport_ct_request(struct fc
>       info->sg = job->reply_payload.sg_list;
> 
>       if (!lport->tt.exch_seq_send(lport, fp, fc_lport_bsg_resp,
> -                                  NULL, info, tov))
> +                                  NULL, info, tov)) {
> +             kfree(info);

We cannot free the BSG info here. If you look at fc_exch_seq_send you
can see that it's attached to the exchange and then when the response is
received it is passed to the response handler, in the case
fc_lport_bsg_resp, where it is free'd.

>               return -ECOMM;
> +     }
>       return 0;
>  }
> _______________________________________________
> devel mailing list
> [email protected]
> http://www.open-fcoe.org/mailman/listinfo/devel


_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to