提交 6ac9f42c 编写于 作者: L Linus Torvalds

Merge tag 'char-misc-4.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

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
...@@ -733,8 +733,8 @@ static int msc_buffer_win_alloc(struct msc *msc, unsigned int nr_blocks) ...@@ -733,8 +733,8 @@ static int msc_buffer_win_alloc(struct msc *msc, unsigned int nr_blocks)
/* Reset the page to write-back before releasing */ /* Reset the page to write-back before releasing */
set_memory_wb((unsigned long)win->block[i].bdesc, 1); set_memory_wb((unsigned long)win->block[i].bdesc, 1);
#endif #endif
dma_free_coherent(msc_dev(msc), size, win->block[i].bdesc, dma_free_coherent(msc_dev(msc)->parent->parent, size,
win->block[i].addr); win->block[i].bdesc, win->block[i].addr);
} }
kfree(win); kfree(win);
...@@ -769,7 +769,7 @@ static void msc_buffer_win_free(struct msc *msc, struct msc_window *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 */ /* Reset the page to write-back before releasing */
set_memory_wb((unsigned long)win->block[i].bdesc, 1); set_memory_wb((unsigned long)win->block[i].bdesc, 1);
#endif #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); win->block[i].bdesc, win->block[i].addr);
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/stm.h> #include <linux/stm.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/vmalloc.h>
#include "stm.h" #include "stm.h"
#include <uapi/linux/stm.h> #include <uapi/linux/stm.h>
...@@ -674,7 +675,7 @@ static void stm_device_release(struct device *dev) ...@@ -674,7 +675,7 @@ static void stm_device_release(struct device *dev)
{ {
struct stm_device *stm = to_stm_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, 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, ...@@ -691,7 +692,7 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data,
return -EINVAL; return -EINVAL;
nmasters = stm_data->sw_end - stm_data->sw_start + 1; 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) if (!stm)
return -ENOMEM; return -ENOMEM;
...@@ -744,7 +745,7 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data, ...@@ -744,7 +745,7 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data,
/* matches device_initialize() above */ /* matches device_initialize() above */
put_device(&stm->dev); put_device(&stm->dev);
err_free: err_free:
kfree(stm); vfree(stm);
return err; return err;
} }
......
...@@ -1255,7 +1255,7 @@ static int icm_ar_get_boot_acl(struct tb *tb, uuid_t *uuids, size_t nuuids) ...@@ -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 */ /* Map empty entries to null UUID */
uuid[0] = 0; uuid[0] = 0;
uuid[1] = 0; uuid[1] = 0;
} else { } else if (uuid[0] != 0 || uuid[1] != 0) {
/* Upper two DWs are always one's */ /* Upper two DWs are always one's */
uuid[2] = 0xffffffff; uuid[2] = 0xffffffff;
uuid[3] = 0xffffffff; uuid[3] = 0xffffffff;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册