--- /dev/null
+From 24ec19b0ae83a385ad9c55520716da671274b96c Mon Sep 17 00:00:00 2001
+From: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
+Date: Thu, 8 Nov 2012 15:11:11 -0500
+Subject: ext4: fix memory leak in ext4_xattr_set_acl()'s error path
+
+From: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
+
+commit 24ec19b0ae83a385ad9c55520716da671274b96c upstream.
+
+In ext4_xattr_set_acl(), if ext4_journal_start() returns an error,
+posix_acl_release() will not be called for 'acl' which may result in a
+memory leak.
+
+This patch fixes that.
+
+Reviewed-by: Lukas Czerner <lczerner@redhat.com>
+Signed-off-by: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/acl.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/fs/ext4/acl.c
++++ b/fs/ext4/acl.c
+@@ -423,8 +423,10 @@ ext4_xattr_set_acl(struct dentry *dentry
+
+ retry:
+ handle = ext4_journal_start(inode, EXT4_DATA_TRANS_BLOCKS(inode->i_sb));
+- if (IS_ERR(handle))
+- return PTR_ERR(handle);
++ if (IS_ERR(handle)) {
++ error = PTR_ERR(handle);
++ goto release_and_out;
++ }
+ error = ext4_set_acl(handle, inode, type, acl);
+ ext4_journal_stop(handle);
+ if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
--- /dev/null
+From aeb1e5d69a5be592e86a926be73efb38c55af404 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Thu, 29 Nov 2012 21:21:22 -0500
+Subject: ext4: fix possible use after free with metadata csum
+
+From: Theodore Ts'o <tytso@mit.edu>
+
+commit aeb1e5d69a5be592e86a926be73efb38c55af404 upstream.
+
+Commit fa77dcfafeaa introduces block bitmap checksum calculation into
+ext4_new_inode() in the case that block group was uninitialized.
+However we brelse() the bitmap buffer before we attempt to checksum it
+so we have no guarantee that the buffer is still there.
+
+Fix this by releasing the buffer after the possible checksum
+computation.
+
+Signed-off-by: Lukas Czerner <lczerner@redhat.com>
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Acked-by: Darrick J. Wong <darrick.wong@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/ialloc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/ext4/ialloc.c
++++ b/fs/ext4/ialloc.c
+@@ -762,7 +762,6 @@ got:
+
+ BUFFER_TRACE(block_bitmap_bh, "dirty block bitmap");
+ err = ext4_handle_dirty_metadata(handle, NULL, block_bitmap_bh);
+- brelse(block_bitmap_bh);
+
+ /* recheck and clear flag under lock if we still need to */
+ ext4_lock_group(sb, group);
+@@ -775,6 +774,7 @@ got:
+ ext4_group_desc_csum_set(sb, group, gdp);
+ }
+ ext4_unlock_group(sb, group);
++ brelse(block_bitmap_bh);
+
+ if (err)
+ goto fail;
--- /dev/null
+From b9fbb62eb61452d728c39b2e5020739c575aac53 Mon Sep 17 00:00:00 2001
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Date: Fri, 9 Nov 2012 16:15:28 +0000
+Subject: mfd: Only unregister platform devices allocated by the mfd core
+
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+
+commit b9fbb62eb61452d728c39b2e5020739c575aac53 upstream.
+
+mfd_remove_devices would iterate over all devices sharing a parent with
+an mfd device regardless of whether they were allocated by the mfd core
+or not. This especially caused problems when the device structure was
+not contained within a platform_device, because to_platform_device is
+used on each device pointer.
+
+This patch defines a device_type for mfd devices and checks this is
+present from mfd_remove_devices_fn before processing the device.
+
+Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Tested-by: Peter Tyser <ptyser@xes-inc.com>
+Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mfd/mfd-core.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+--- a/drivers/mfd/mfd-core.c
++++ b/drivers/mfd/mfd-core.c
+@@ -21,6 +21,10 @@
+ #include <linux/irqdomain.h>
+ #include <linux/of.h>
+
++static struct device_type mfd_dev_type = {
++ .name = "mfd_device",
++};
++
+ int mfd_cell_enable(struct platform_device *pdev)
+ {
+ const struct mfd_cell *cell = mfd_get_cell(pdev);
+@@ -91,6 +95,7 @@ static int mfd_add_device(struct device
+ goto fail_device;
+
+ pdev->dev.parent = parent;
++ pdev->dev.type = &mfd_dev_type;
+
+ if (parent->of_node && cell->of_compatible) {
+ for_each_child_of_node(parent->of_node, np) {
+@@ -204,10 +209,16 @@ EXPORT_SYMBOL(mfd_add_devices);
+
+ static int mfd_remove_devices_fn(struct device *dev, void *c)
+ {
+- struct platform_device *pdev = to_platform_device(dev);
+- const struct mfd_cell *cell = mfd_get_cell(pdev);
++ struct platform_device *pdev;
++ const struct mfd_cell *cell;
+ atomic_t **usage_count = c;
+
++ if (dev->type != &mfd_dev_type)
++ return 0;
++
++ pdev = to_platform_device(dev);
++ cell = mfd_get_cell(pdev);
++
+ /* find the base address of usage_count pointers (for freeing) */
+ if (!*usage_count || (cell->usage_count < *usage_count))
+ *usage_count = cell->usage_count;
--- /dev/null
+From 90a38d999739f35f4fc925c875e6ee518546b66c Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+Date: Mon, 15 Oct 2012 22:44:45 +0200
+Subject: mfd: Remove Unicode Byte Order Marks from da9055
+
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+
+commit 90a38d999739f35f4fc925c875e6ee518546b66c upstream.
+
+Older gcc (< 4.4) doesn't like files starting with Unicode BOMs:
+
+include/linux/mfd/da9055/core.h:1: error: stray ‘\357’ in program
+include/linux/mfd/da9055/core.h:1: error: stray ‘\273’ in program
+include/linux/mfd/da9055/core.h:1: error: stray ‘\277’ in program
+include/linux/mfd/da9055/pdata.h:1: error: stray ‘\357’ in program
+include/linux/mfd/da9055/pdata.h:1: error: stray ‘\273’ in program
+include/linux/mfd/da9055/pdata.h:1: error: stray ‘\277’ in program
+include/linux/mfd/da9055/reg.h:1: error: stray ‘\357’ in program
+include/linux/mfd/da9055/reg.h:1: error: stray ‘\273’ in program
+include/linux/mfd/da9055/reg.h:1: error: stray ‘\277’ in program
+
+Remove the BOMs, the rest of the files is plain ASCII anyway.
+
+Output of "file" before:
+
+include/linux/mfd/da9055/core.h: UTF-8 Unicode (with BOM) C program text
+include/linux/mfd/da9055/pdata.h: UTF-8 Unicode (with BOM) C program text
+include/linux/mfd/da9055/reg.h: UTF-8 Unicode (with BOM) C program text
+
+Output of "file" after:
+
+include/linux/mfd/da9055/core.h: ASCII C program text
+include/linux/mfd/da9055/pdata.h: ASCII C program text
+include/linux/mfd/da9055/reg.h: ASCII C program text
+
+Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/mfd/da9055/core.h | 2 +-
+ include/linux/mfd/da9055/pdata.h | 2 +-
+ include/linux/mfd/da9055/reg.h | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/include/linux/mfd/da9055/core.h
++++ b/include/linux/mfd/da9055/core.h
+@@ -1,4 +1,4 @@
+-/*
++/*
+ * da9055 declarations for DA9055 PMICs.
+ *
+ * Copyright(c) 2012 Dialog Semiconductor Ltd.
+--- a/include/linux/mfd/da9055/pdata.h
++++ b/include/linux/mfd/da9055/pdata.h
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2012 Dialog Semiconductor Ltd.
++/* Copyright (C) 2012 Dialog Semiconductor Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+--- a/include/linux/mfd/da9055/reg.h
++++ b/include/linux/mfd/da9055/reg.h
+@@ -1,4 +1,4 @@
+-/*
++/*
+ * DA9055 declarations for DA9055 PMICs.
+ *
+ * Copyright(c) 2012 Dialog Semiconductor Ltd.
--- /dev/null
+From fee546ce8cfd9dea1f53175f627e17ef5ff05df4 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Fri, 23 Nov 2012 12:05:33 +0900
+Subject: mfd: wm8994: Add support for WM1811 rev E
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit fee546ce8cfd9dea1f53175f627e17ef5ff05df4 upstream.
+
+This is supported identically to the previous revisions.
+
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mfd/wm8994-core.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/mfd/wm8994-core.c
++++ b/drivers/mfd/wm8994-core.c
+@@ -557,6 +557,7 @@ static __devinit int wm8994_device_init(
+ case 1:
+ case 2:
+ case 3:
++ case 4:
+ regmap_patch = wm1811_reva_patch;
+ patch_regs = ARRAY_SIZE(wm1811_reva_patch);
+ break;
target-file-fix-32-bit-highmem-breakage-for-sgl-iovec-mapping.patch
target-tcm_fc-fix-the-lockdep-warning-due-to-inconsistent-lock-state.patch
sbp-target-fix-error-path-in-sbp_make_tpg.patch
+mfd-wm8994-add-support-for-wm1811-rev-e.patch
+mfd-only-unregister-platform-devices-allocated-by-the-mfd-core.patch
+mfd-remove-unicode-byte-order-marks-from-da9055.patch
+ext4-fix-memory-leak-in-ext4_xattr_set_acl-s-error-path.patch
+ext4-fix-possible-use-after-free-with-metadata-csum.patch