Merge tag 'char-misc-4.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 2 Jun 2018 17:05:45 +0000 (10:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 2 Jun 2018 17:05:45 +0000 (10:05 -0700)
Pull char/misc driver fixes from Greg KH:
 "Here are four small bugfixes for some char/misc drivers. Well, really
  three fixes and one fix for one of those fixes due to problems found
  by 0-day.

  This resolves some reported issues with the hwtracing drivers, and a
  reported regression for the thunderbolt subsystem. All of these have
  been in linux-next for a while now with no reported problems"

* tag 'char-misc-4.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  hwtracing: stm: fix build error on some arches
  intel_th: Use correct device when freeing buffers
  stm class: Use vmalloc for the master map
  thunderbolt: Handle NULL boot ACL entries properly

drivers/hwtracing/intel_th/msu.c
drivers/hwtracing/stm/core.c
drivers/thunderbolt/icm.c

index ede388309376f5d5680298787bcc541b9f8c86e4..634f58042c77f36b7e512a84510e2ac8947eab0e 100644 (file)
@@ -733,8 +733,8 @@ err_nomem:
                /* Reset the page to write-back before releasing */
                set_memory_wb((unsigned long)win->block[i].bdesc, 1);
 #endif
-               dma_free_coherent(msc_dev(msc), size, win->block[i].bdesc,
-                                 win->block[i].addr);
+               dma_free_coherent(msc_dev(msc)->parent->parent, size,
+                                 win->block[i].bdesc, win->block[i].addr);
        }
        kfree(win);
 
@@ -769,7 +769,7 @@ static void msc_buffer_win_free(struct msc *msc, struct msc_window *win)
                /* Reset the page to write-back before releasing */
                set_memory_wb((unsigned long)win->block[i].bdesc, 1);
 #endif
-               dma_free_coherent(msc_dev(win->msc), PAGE_SIZE,
+               dma_free_coherent(msc_dev(win->msc)->parent->parent, PAGE_SIZE,
                                  win->block[i].bdesc, win->block[i].addr);
        }
 
index 05386b76465ed56105436b4d3b15da98d8051bf1..10bcb5d73f90ed45119f473b63ec3d6668c3c073 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/stm.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
+#include <linux/vmalloc.h>
 #include "stm.h"
 
 #include <uapi/linux/stm.h>
@@ -674,7 +675,7 @@ static void stm_device_release(struct device *dev)
 {
        struct stm_device *stm = to_stm_device(dev);
 
-       kfree(stm);
+       vfree(stm);
 }
 
 int stm_register_device(struct device *parent, struct stm_data *stm_data,
@@ -691,7 +692,7 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data,
                return -EINVAL;
 
        nmasters = stm_data->sw_end - stm_data->sw_start + 1;
-       stm = kzalloc(sizeof(*stm) + nmasters * sizeof(void *), GFP_KERNEL);
+       stm = vzalloc(sizeof(*stm) + nmasters * sizeof(void *));
        if (!stm)
                return -ENOMEM;
 
@@ -744,7 +745,7 @@ err_device:
        /* matches device_initialize() above */
        put_device(&stm->dev);
 err_free:
-       kfree(stm);
+       vfree(stm);
 
        return err;
 }
index 2d2ceda9aa2691ed3b7d38752a74bcaf06955547..500911f1649852d91641e607be198228b9e185a2 100644 (file)
@@ -1255,7 +1255,7 @@ static int icm_ar_get_boot_acl(struct tb *tb, uuid_t *uuids, size_t nuuids)
                        /* Map empty entries to null UUID */
                        uuid[0] = 0;
                        uuid[1] = 0;
-               } else {
+               } else if (uuid[0] != 0 || uuid[1] != 0) {
                        /* Upper two DWs are always one's */
                        uuid[2] = 0xffffffff;
                        uuid[3] = 0xffffffff;