Re: [PATCH][sas] Fix potential NULL pointer dereference bug in sas_smp_get_phy_events()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jesper Juhl <jesper.juhl@...>
Cc: <linux-scsi@...>, Luben Tuikov <luben_tuikov@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Friday, July 27, 2007 - 7:02 pm

On Fri, 2007-07-27 at 23:27 +0200, Jesper Juhl wrote:

Actually, this should be alloc_smp_resp(RPEL_RESP_SIZE);


Just for the sake of being the same as all the rest of the code, the
sequence should be

	req = alloc_smp_req(xxx_REQ_SIZE);
	if (!req)
		return -ENOMEM;

	resp = alloc_smp_resp(xxx_RESP_SIZE);
	if (!resp) {
		kfree(req);
		return -ENOMEM;
	}

(allocate request then response).

It looks like disc_resp could use a little love too (it's using the req
alloc routines).

James

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH][sas] Fix potential NULL pointer dereference bug ..., James Bottomley, (Fri Jul 27, 7:02 pm)