From: Ben Hutchings <ben@decadent.org.uk>
To: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/3] i2o: Fix DMA mapping leak in failure path of i2o_cfg_passthru32()
Date: Thu, 06 Nov 2014 03:25:43 +0000 [thread overview]
Message-ID: <1415244343.3398.47.camel@decadent.org.uk> (raw)
In-Reply-To: <1415244281.3398.46.camel@decadent.org.uk>
[-- Attachment #1: Type: text/plain, Size: 924 bytes --]
If i2o_dma_alloc() fails then we don't free any DMA mappings already
allocated. i2o_cfg_passthru() does not have this bug.
Compile-tested only.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
drivers/message/i2o/i2o_config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 04bd3b6..274235d 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -630,7 +630,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd,
"%s:Bad SG element %d - not simple (%x)\n",
c->name, i, sg[i].flag_count);
rcode = -EINVAL;
- goto cleanup;
+ goto sg_list_cleanup;
}
sg_size = sg[i].flag_count & 0xffffff;
p = &(sg_list[sg_index]);
--
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
next prev parent reply other threads:[~2014-11-06 3:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 3:24 [PATCH 0/3] i2o: I2OPASSTHRU fix and cleanup Ben Hutchings
2014-11-06 3:25 ` Ben Hutchings [this message]
2014-11-06 3:26 ` [PATCH 2/3] i2o: Define i2o_cfg_passthru() and i2o_cfg_passthru32() consistently Ben Hutchings
2014-11-06 3:27 ` [PATCH 3/3] i2o: Delete the '64bit fix' comments from __i2o_cfg_passthru() Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415244343.3398.47.camel@decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®