[PATCH 3/4] mpt3sas: fix possible memory leak in mpt3sas_send_trigger_data_event

2014-06-02 Thread Joe Lawrence
If mpt3sas_send_trigger_data_event exits early without inserting a fw_event, be sure to undo any prior allocations. This fixes the following smatch warning: drivers/scsi/mpt3sas/mpt3sas_scsih.c:2522 mpt3sas_send_trigger_data_event() warn: possible memory leak of 'fw_event'

Re: [PATCH 3/4] mpt3sas: fix possible memory leak in mpt3sas_send_trigger_data_event

2014-06-02 Thread Christoph Hellwig
On Mon, Jun 02, 2014 at 10:37:26AM -0400, Joe Lawrence wrote: If mpt3sas_send_trigger_data_event exits early without inserting a fw_event, be sure to undo any prior allocations. Looks good, but why don't we just allocate the two in a single allocation? Reviewed-by: Christoph Hellwig