megaraid:Fix possible NULL pointer deference in mraid_mm_ioctl
A message that is not in the archive (sent off-list or not yet received): [email protected]
Sumit Saxena
Acked-byQuoted 11 lines
-----Original Message-----
From: Nicholas Krause [mailto:[email protected]]
Sent: Wednesday, January 06, 2016 1:03 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]
Subject: [PATCH] megaraid:Fix possible NULL pointer deference inmraid_mm_ioctl
Quoted 1 line
This adds the needed check after the call to the function
mraid_mm_alloc_kioc
Quoted 1 line
in order to make sure that this function has not returned NULL and
therefore
Quoted 3 lines
makes sure we do not deference a NULL pointer if one is returned by
mraid_mm_alloc_kioc.
Further more add needed comments explaining that this function call can
return
Quoted 1 line
NULL if the list head is empty for the pointer passed in order to allow
furture
drivers/scsi/megaraid/megaraid_mm.c mraid_mm_ioctl(struct file *filep, unsigned int
Quoted 13 lines
users to understand this required pointer check.
Signed-off-by Nicholas Krause <[email protected]>--- drivers/scsi/megaraid/megaraid_mm.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/scsi/megaraid/megaraid_mm.c +0
-0@@ -179,8 +179,12 @@ mraid_mm_ioctl(struct file *filep, unsigned int
cmd,
Quoted 12 lines
drivers/scsi/megaraid/megaraid_mm.c +4
-0unsigned long arg)/* * The following call will block till a kioc is available +* or return NULL if the list head is empty for the pointer +* of type mraid_mmapt passed to mraid_mm_alloc_kioc */ kioc =mraid_mm_alloc_kioc (adp); +if (!kioc) +return -ENXIO ;/*
Quoted 1 line
* User sent the old
mimd_tioctl packet. Convert it touioc_t.
Quoted 2 lines
--
2.5.0