]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2013 20:25:35 +0000 (12:25 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2013 20:25:35 +0000 (12:25 -0800)
added patches:
nfs-fix-do_div-warning-by-instead-using-sector_div.patch
staging-comedi-pcmuio-fix-possible-null-deref-on-detach.patch

queue-3.4/nfs-fix-do_div-warning-by-instead-using-sector_div.patch [new file with mode: 0644]
queue-3.4/series
queue-3.4/staging-comedi-pcmuio-fix-possible-null-deref-on-detach.patch [new file with mode: 0644]

diff --git a/queue-3.4/nfs-fix-do_div-warning-by-instead-using-sector_div.patch b/queue-3.4/nfs-fix-do_div-warning-by-instead-using-sector_div.patch
new file mode 100644 (file)
index 0000000..6886a3e
--- /dev/null
@@ -0,0 +1,40 @@
+From 3873d064b8538686bbbd4b858dc8a07db1f7f43a Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Mon, 2 Dec 2013 19:59:31 +0100
+Subject: nfs: fix do_div() warning by instead using sector_div()
+
+From: Helge Deller <deller@gmx.de>
+
+commit 3873d064b8538686bbbd4b858dc8a07db1f7f43a upstream.
+
+When compiling a 32bit kernel with CONFIG_LBDAF=n the compiler complains like
+shown below.  Fix this warning by instead using sector_div() which is provided
+by the kernel.h header file.
+
+fs/nfs/blocklayout/extents.c: In function ‘normalize’:
+include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast [enabled by default]
+fs/nfs/blocklayout/extents.c:47:13: note: in expansion of macro ‘do_div’
+nfs/blocklayout/extents.c:47:2: warning: right shift count >= width of type [enabled by default]
+fs/nfs/blocklayout/extents.c:47:2: warning: passing argument 1 of ‘__div64_32’ from incompatible pointer type [enabled by default]
+include/asm-generic/div64.h:35:17: note: expected ‘uint64_t *’ but argument is of type ‘sector_t *’
+ extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/blocklayout/extents.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/nfs/blocklayout/extents.c
++++ b/fs/nfs/blocklayout/extents.c
+@@ -44,7 +44,7 @@
+ static inline sector_t normalize(sector_t s, int base)
+ {
+       sector_t tmp = s; /* Since do_div modifies its argument */
+-      return s - do_div(tmp, base);
++      return s - sector_div(tmp, base);
+ }
+ static inline sector_t normalize_up(sector_t s, int base)
index 391ca598ad02631a0fe8240b6910b5bd0e3632fa..141011987c2cfb02612c21d655c2e9ca91ecdc5d 100644 (file)
@@ -23,3 +23,5 @@ x86-efi-don-t-use-u-efi-time-services-on-32-bit.patch
 dm-bufio-initialize-read-only-module-parameters.patch
 dm-delay-fix-a-possible-deadlock-due-to-shared-workqueue.patch
 dm-table-fail-dm_table_create-on-dm_round_up-overflow.patch
+nfs-fix-do_div-warning-by-instead-using-sector_div.patch
+staging-comedi-pcmuio-fix-possible-null-deref-on-detach.patch
diff --git a/queue-3.4/staging-comedi-pcmuio-fix-possible-null-deref-on-detach.patch b/queue-3.4/staging-comedi-pcmuio-fix-possible-null-deref-on-detach.patch
new file mode 100644 (file)
index 0000000..90be9a3
--- /dev/null
@@ -0,0 +1,46 @@
+From 2fd2bdfccae61efe18f6b92b6a45fbf936d75b48 Mon Sep 17 00:00:00 2001
+From: Ian Abbott <abbotti@mev.co.uk>
+Date: Tue, 20 Aug 2013 11:50:19 +0100
+Subject: staging: comedi: pcmuio: fix possible NULL deref on detach
+
+From: Ian Abbott <abbotti@mev.co.uk>
+
+commit 2fd2bdfccae61efe18f6b92b6a45fbf936d75b48 upstream.
+
+pcmuio_detach() is called by the comedi core even if pcmuio_attach()
+returned an error, so `dev->private` might be `NULL`.  Check for that
+before dereferencing it.
+
+Also, as pointed out by Dan Carpenter, there is no need to check the
+pointer passed to `kfree()` is non-NULL, so remove that check.
+
+Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
+Cc: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/comedi/drivers/pcmuio.c |   12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/drivers/staging/comedi/drivers/pcmuio.c
++++ b/drivers/staging/comedi/drivers/pcmuio.c
+@@ -464,13 +464,13 @@ static int pcmuio_detach(struct comedi_d
+       if (dev->iobase)
+               release_region(dev->iobase, ASIC_IOSIZE * thisboard->num_asics);
+-      for (i = 0; i < MAX_ASICS; ++i) {
+-              if (devpriv->asics[i].irq)
+-                      free_irq(devpriv->asics[i].irq, dev);
+-      }
+-
+-      if (devpriv && devpriv->sprivs)
++      if (devpriv) {
++              for (i = 0; i < MAX_ASICS; ++i) {
++                      if (devpriv->asics[i].irq)
++                              free_irq(devpriv->asics[i].irq, dev);
++              }
+               kfree(devpriv->sprivs);
++      }
+       return 0;
+ }