Date: Sun, 19 Jul 2009 21:40:39 +0200 From: Michael Buesch Subject: ieee1394: raw1394: Do not leak memory on failed trylock. Do not leak the allocated memory in case the mutex_trylock() failed to acquire the lock. Signed-off-by: Michael Buesch This bug does not happen in practice: All raw1394 clients use libraw1394, and accesses to a libraw1394 handle need to be serialized by the client. This is documented in libraw1394's API reference. Signed-off-by: Stefan Richter --- drivers/ieee1394/raw1394.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6.31/drivers/ieee1394/raw1394.c =================================================================== --- linux-2.6.31.orig/drivers/ieee1394/raw1394.c +++ linux-2.6.31/drivers/ieee1394/raw1394.c @@ -2272,8 +2272,10 @@ static ssize_t raw1394_write(struct file return -EFAULT; } - if (!mutex_trylock(&fi->state_mutex)) + if (!mutex_trylock(&fi->state_mutex)) { + free_pending_request(req); return -EAGAIN; + } switch (fi->state) { case opened: