Skip to contentSkip to conversation

mptfusion: (Fix) mptctl_release is required in mptctl.c

PATCH In review Kashyap, Desai 1 participant 1 message Feb 10, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 mptfusion: (Fix) mptctl_release is required in mptctl.c

Added missing release callback for file_operations mptctl_fops. Without release callback there will be never freed. It remains on mptctl's eent list even after the file is closed and released.

Relavent RHEL bugzilla is 660871

---

drivers/message/fusion/mptctl.c +8 -0
index a3856ed..e8deb8e 100644
@@ -597,6 +597,13 @@ mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
 }
 
 static int
+mptctl_release(struct inode *inode, struct file *filep)
+{
+	fasync_helper(-1, filep, 0, &async_queue);
+	return 0;
+}
+
+static int
 mptctl_fasync(int fd, struct file *filep, int mode)
 {
 	MPT_ADAPTER	*ioc;
@@ -2815,6 +2822,7 @@ static const struct file_operations mptctl_fops = {
 	.llseek =	no_llseek,
 	.fasync = 	mptctl_fasync,
 	.unlocked_ioctl = mptctl_ioctl,
+	.release =	mptctl_release,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = compat_mpctl_ioctl,
 #endif