Commit 919fae16 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.infradead.org/users/dwmw2/random-2.6

* git://git.infradead.org/users/dwmw2/random-2.6:
  [MTD] mtdchar.c: Fix regression in MEMGETREGIONINFO ioctl()
  dabusb_fpga_download(): fix a memory leak
  Remove '#include <stddef.h>' from mm/page_isolation.c
  Fix modules_install on RO nfs-exported trees.
parents e77295dc b67c5f87
...@@ -403,6 +403,7 @@ static int dabusb_fpga_download (pdabusb_t s, const char *fname) ...@@ -403,6 +403,7 @@ static int dabusb_fpga_download (pdabusb_t s, const char *fname)
ret = request_firmware(&fw, "dabusb/bitstream.bin", &s->usbdev->dev); ret = request_firmware(&fw, "dabusb/bitstream.bin", &s->usbdev->dev);
if (ret) { if (ret) {
err("Failed to load \"dabusb/bitstream.bin\": %d\n", ret); err("Failed to load \"dabusb/bitstream.bin\": %d\n", ret);
kfree(b);
return ret; return ret;
} }
......
...@@ -410,16 +410,20 @@ static int mtd_ioctl(struct inode *inode, struct file *file, ...@@ -410,16 +410,20 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
case MEMGETREGIONINFO: case MEMGETREGIONINFO:
{ {
struct region_info_user ur; uint32_t ur_idx;
struct mtd_erase_region_info *kr;
struct region_info_user *ur = (struct region_info_user *) argp;
if (copy_from_user(&ur, argp, sizeof(struct region_info_user))) if (get_user(ur_idx, &(ur->regionindex)))
return -EFAULT; return -EFAULT;
if (ur.regionindex >= mtd->numeraseregions) kr = &(mtd->eraseregions[ur_idx]);
return -EINVAL;
if (copy_to_user(argp, &(mtd->eraseregions[ur.regionindex]), if (put_user(kr->offset, &(ur->offset))
sizeof(struct mtd_erase_region_info))) || put_user(kr->erasesize, &(ur->erasesize))
|| put_user(kr->numblocks, &(ur->numblocks)))
return -EFAULT; return -EFAULT;
break; break;
} }
......
...@@ -146,15 +146,27 @@ $(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/% ...@@ -146,15 +146,27 @@ $(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/%
$(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %) $(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %)
$(call cmd,ihex) $(call cmd,ihex)
# Don't depend on ihex2fw if we're installing and it already exists.
# Putting it after | in the dependencies doesn't seem sufficient when
# we're installing after a cross-compile, because ihex2fw has dependencies
# on stuff like /usr/lib/gcc/ppc64-redhat-linux/4.3.0/include/stddef.h and
# thus wants to be rebuilt. Which it can't be, if the prebuilt kernel tree
# is exported read-only for someone to run 'make install'.
ifeq ($(INSTALL):$(wildcard $(obj)/ihex2fw),install:$(obj)/ihex2fw)
ihex2fw_dep :=
else
ihex2fw_dep := $(obj)/ihex2fw
endif
# .HEX is also Intel HEX, but where the offset and length in each record # .HEX is also Intel HEX, but where the offset and length in each record
# is actually meaningful, because the firmware has to be loaded in a certain # is actually meaningful, because the firmware has to be loaded in a certain
# order rather than as a single binary blob. Thus, we convert them into our # order rather than as a single binary blob. Thus, we convert them into our
# more compact binary representation of ihex records (<linux/ihex.h>) # more compact binary representation of ihex records (<linux/ihex.h>)
$(obj)/%.fw: $(obj)/%.HEX $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %) $(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
$(call cmd,ihex2fw) $(call cmd,ihex2fw)
# .H16 is our own modified form of Intel HEX, with 16-bit length for records. # .H16 is our own modified form of Intel HEX, with 16-bit length for records.
$(obj)/%.fw: $(obj)/%.H16 $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %) $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
$(call cmd,h16tofw) $(call cmd,h16tofw)
$(firmware-dirs): $(firmware-dirs):
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
* linux/mm/page_isolation.c * linux/mm/page_isolation.c
*/ */
#include <stddef.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/page-isolation.h> #include <linux/page-isolation.h>
#include <linux/pageblock-flags.h> #include <linux/pageblock-flags.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment