diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/microblaze/boot/Makefile linux-libre-3.18.118-gnu/arch/microblaze/boot/Makefile
--- linux-libre-3.18.117-gnu/arch/microblaze/boot/Makefile	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/microblaze/boot/Makefile	2018-08-09 06:20:36.000000000 -0400
@@ -21,18 +21,20 @@ $(obj)/linux.bin.gz: $(obj)/linux.bin FO
 quiet_cmd_cp = CP      $< $@$2
 	cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
 
-quiet_cmd_strip = STRIP   $@
+quiet_cmd_strip = STRIP   $< $@$2
 	cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \
-				-K _fdt_start vmlinux -o $@
+				-K _fdt_start $< -o $@$2
 
 UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR)
+UIMAGE_IN = $@
+UIMAGE_OUT = $@.ub
 
 $(obj)/simpleImage.%: vmlinux FORCE
 	$(call if_changed,cp,.unstrip)
 	$(call if_changed,objcopy)
 	$(call if_changed,uimage)
-	$(call if_changed,strip)
-	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
+	$(call if_changed,strip,.strip)
+	@echo 'Kernel: $(UIMAGE_OUT) is ready' ' (#'`cat .version`')'
 
 
 clean-files += simpleImage.*.unstrip linux.bin.ub
diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/powerpc/kernel/head_8xx.S linux-libre-3.18.118-gnu/arch/powerpc/kernel/head_8xx.S
--- linux-libre-3.18.117-gnu/arch/powerpc/kernel/head_8xx.S	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/powerpc/kernel/head_8xx.S	2018-08-09 06:20:36.000000000 -0400
@@ -722,7 +722,7 @@ start_here:
 	tovirt(r6,r6)
 	lis	r5, abatron_pteptrs@h
 	ori	r5, r5, abatron_pteptrs@l
-	stw	r5, 0xf0(r0)	/* Must match your Abatron config file */
+	stw	r5, 0xf0(0)	/* Must match your Abatron config file */
 	tophys(r5,r5)
 	stw	r6, 0(r5)
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/powerpc/kernel/pci_32.c linux-libre-3.18.118-gnu/arch/powerpc/kernel/pci_32.c
--- linux-libre-3.18.117-gnu/arch/powerpc/kernel/pci_32.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/powerpc/kernel/pci_32.c	2018-08-09 06:20:36.000000000 -0400
@@ -11,6 +11,7 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/bootmem.h>
+#include <linux/syscalls.h>
 #include <linux/irq.h>
 #include <linux/list.h>
 #include <linux/of.h>
diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/powerpc/platforms/chrp/time.c linux-libre-3.18.118-gnu/arch/powerpc/platforms/chrp/time.c
--- linux-libre-3.18.117-gnu/arch/powerpc/platforms/chrp/time.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/powerpc/platforms/chrp/time.c	2018-08-09 06:20:36.000000000 -0400
@@ -27,6 +27,8 @@
 #include <asm/sections.h>
 #include <asm/time.h>
 
+#include <platforms/chrp/chrp.h>
+
 extern spinlock_t rtc_lock;
 
 #define NVRAM_AS0  0x74
@@ -62,7 +64,7 @@ long __init chrp_time_init(void)
 	return 0;
 }
 
-int chrp_cmos_clock_read(int addr)
+static int chrp_cmos_clock_read(int addr)
 {
 	if (nvram_as1 != 0)
 		outb(addr>>8, nvram_as1);
@@ -70,7 +72,7 @@ int chrp_cmos_clock_read(int addr)
 	return (inb(nvram_data));
 }
 
-void chrp_cmos_clock_write(unsigned long val, int addr)
+static void chrp_cmos_clock_write(unsigned long val, int addr)
 {
 	if (nvram_as1 != 0)
 		outb(addr>>8, nvram_as1);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/powerpc/platforms/embedded6xx/hlwd-pic.c linux-libre-3.18.118-gnu/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
--- linux-libre-3.18.117-gnu/arch/powerpc/platforms/embedded6xx/hlwd-pic.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/powerpc/platforms/embedded6xx/hlwd-pic.c	2018-08-09 06:20:36.000000000 -0400
@@ -35,6 +35,8 @@
  */
 #define HW_BROADWAY_ICR		0x00
 #define HW_BROADWAY_IMR		0x04
+#define HW_STARLET_ICR		0x08
+#define HW_STARLET_IMR		0x0c
 
 
 /*
@@ -74,6 +76,9 @@ static void hlwd_pic_unmask(struct irq_d
 	void __iomem *io_base = irq_data_get_irq_chip_data(d);
 
 	setbits32(io_base + HW_BROADWAY_IMR, 1 << irq);
+
+	/* Make sure the ARM (aka. Starlet) doesn't handle this interrupt. */
+	clrbits32(io_base + HW_STARLET_IMR, 1 << irq);
 }
 
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/powerpc/platforms/powermac/bootx_init.c linux-libre-3.18.118-gnu/arch/powerpc/platforms/powermac/bootx_init.c
--- linux-libre-3.18.117-gnu/arch/powerpc/platforms/powermac/bootx_init.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/powerpc/platforms/powermac/bootx_init.c	2018-08-09 06:20:36.000000000 -0400
@@ -467,7 +467,7 @@ void __init bootx_init(unsigned long r3,
 	boot_infos_t *bi = (boot_infos_t *) r4;
 	unsigned long hdr;
 	unsigned long space;
-	unsigned long ptr, x;
+	unsigned long ptr;
 	char *model;
 	unsigned long offset = reloc_offset();
 
@@ -561,6 +561,8 @@ void __init bootx_init(unsigned long r3,
 	 * MMU switched OFF, so this should not be useful anymore.
 	 */
 	if (bi->version < 4) {
+		unsigned long x __maybe_unused;
+
 		bootx_printf("Touching pages...\n");
 
 		/*
diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/powerpc/platforms/powermac/setup.c linux-libre-3.18.118-gnu/arch/powerpc/platforms/powermac/setup.c
--- linux-libre-3.18.117-gnu/arch/powerpc/platforms/powermac/setup.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/powerpc/platforms/powermac/setup.c	2018-08-09 06:20:36.000000000 -0400
@@ -359,6 +359,7 @@ static int pmac_late_init(void)
 }
 machine_late_initcall(powermac, pmac_late_init);
 
+void note_bootable_part(dev_t dev, int part, int goodness);
 /*
  * This is __init_refok because we check for "initializing" before
  * touching any of the __init sensitive things and "initializing"
diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/s390/include/asm/cpu_mf.h linux-libre-3.18.118-gnu/arch/s390/include/asm/cpu_mf.h
--- linux-libre-3.18.117-gnu/arch/s390/include/asm/cpu_mf.h	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/s390/include/asm/cpu_mf.h	2018-08-09 06:20:36.000000000 -0400
@@ -118,7 +118,7 @@ struct hws_basic_entry {
 
 struct hws_diag_entry {
 	unsigned int def:16;	    /* 0-15  Data Entry Format		 */
-	unsigned int R:14;	    /* 16-19 and 20-30 reserved		 */
+	unsigned int R:15;	    /* 16-19 and 20-30 reserved		 */
 	unsigned int I:1;	    /* 31 entry valid or invalid	 */
 	u8	     data[];	    /* Machine-dependent sample data	 */
 } __packed;
@@ -134,7 +134,9 @@ struct hws_trailer_entry {
 			unsigned int f:1;	/* 0 - Block Full Indicator   */
 			unsigned int a:1;	/* 1 - Alert request control  */
 			unsigned int t:1;	/* 2 - Timestamp format	      */
-			unsigned long long:61;	/* 3 - 63: Reserved	      */
+			unsigned int :29;	/* 3 - 31: Reserved	      */
+			unsigned int bsdes:16;	/* 32-47: size of basic SDE   */
+			unsigned int dsdes:16;	/* 48-63: size of diagnostic SDE */
 		};
 		unsigned long long flags;	/* 0 - 63: All indicators     */
 	};
diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/x86/kernel/cpu/perf_event_intel_uncore.c linux-libre-3.18.118-gnu/arch/x86/kernel/cpu/perf_event_intel_uncore.c
--- linux-libre-3.18.117-gnu/arch/x86/kernel/cpu/perf_event_intel_uncore.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/x86/kernel/cpu/perf_event_intel_uncore.c	2018-08-09 06:20:36.000000000 -0400
@@ -175,7 +175,7 @@ void uncore_perf_event_update(struct int
 	u64 prev_count, new_count, delta;
 	int shift;
 
-	if (event->hw.idx >= UNCORE_PMC_IDX_FIXED)
+	if (event->hw.idx == UNCORE_PMC_IDX_FIXED)
 		shift = 64 - uncore_fixed_ctr_bits(box);
 	else
 		shift = 64 - uncore_perf_ctr_bits(box);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/arch/x86/kernel/cpu/perf_event_intel_uncore_nhmex.c linux-libre-3.18.118-gnu/arch/x86/kernel/cpu/perf_event_intel_uncore_nhmex.c
--- linux-libre-3.18.117-gnu/arch/x86/kernel/cpu/perf_event_intel_uncore_nhmex.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/arch/x86/kernel/cpu/perf_event_intel_uncore_nhmex.c	2018-08-09 06:20:36.000000000 -0400
@@ -240,7 +240,7 @@ static void nhmex_uncore_msr_enable_even
 {
 	struct hw_perf_event *hwc = &event->hw;
 
-	if (hwc->idx >= UNCORE_PMC_IDX_FIXED)
+	if (hwc->idx == UNCORE_PMC_IDX_FIXED)
 		wrmsrl(hwc->config_base, NHMEX_PMON_CTL_EN_BIT0);
 	else if (box->pmu->type->event_mask & NHMEX_PMON_CTL_EN_BIT0)
 		wrmsrl(hwc->config_base, hwc->config | NHMEX_PMON_CTL_EN_BIT22);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/crypto/authenc.c linux-libre-3.18.118-gnu/crypto/authenc.c
--- linux-libre-3.18.117-gnu/crypto/authenc.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/crypto/authenc.c	2018-08-09 06:20:36.000000000 -0400
@@ -112,6 +112,7 @@ static int crypto_authenc_setkey(struct
 				       CRYPTO_TFM_RES_MASK);
 
 out:
+	memzero_explicit(&keys, sizeof(keys));
 	return err;
 
 badkey:
diff -druNp --no-dereference linux-libre-3.18.117-gnu/crypto/authencesn.c linux-libre-3.18.118-gnu/crypto/authencesn.c
--- linux-libre-3.18.117-gnu/crypto/authencesn.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/crypto/authencesn.c	2018-08-09 06:20:36.000000000 -0400
@@ -86,6 +86,7 @@ static int crypto_authenc_esn_setkey(str
 					   CRYPTO_TFM_RES_MASK);
 
 out:
+	memzero_explicit(&keys, sizeof(keys));
 	return err;
 
 badkey:
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/acpi/pci_root.c linux-libre-3.18.118-gnu/drivers/acpi/pci_root.c
--- linux-libre-3.18.117-gnu/drivers/acpi/pci_root.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/acpi/pci_root.c	2018-08-09 06:20:36.000000000 -0400
@@ -476,9 +476,11 @@ static void negotiate_os_control(struct
 	}
 
 	control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL
-		| OSC_PCI_EXPRESS_NATIVE_HP_CONTROL
 		| OSC_PCI_EXPRESS_PME_CONTROL;
 
+	if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE))
+		control |= OSC_PCI_EXPRESS_NATIVE_HP_CONTROL;
+
 	if (pci_aer_available()) {
 		if (aer_acpi_firmware_first())
 			dev_info(&device->dev,
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/ata/libata-eh.c linux-libre-3.18.118-gnu/drivers/ata/libata-eh.c
--- linux-libre-3.18.117-gnu/drivers/ata/libata-eh.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/ata/libata-eh.c	2018-08-09 06:20:36.000000000 -0400
@@ -2173,12 +2173,16 @@ static void ata_eh_link_autopsy(struct a
 		if (qc->err_mask & ~AC_ERR_OTHER)
 			qc->err_mask &= ~AC_ERR_OTHER;
 
-		/* SENSE_VALID trumps dev/unknown error and revalidation */
+		/*
+		 * SENSE_VALID trumps dev/unknown error and revalidation. Upper
+		 * layers will determine whether the command is worth retrying
+		 * based on the sense data and device class/type. Otherwise,
+		 * determine directly if the command is worth retrying using its
+		 * error mask and flags.
+		 */
 		if (qc->flags & ATA_QCFLAG_SENSE_VALID)
 			qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER);
-
-		/* determine whether the command is worth retrying */
-		if (ata_eh_worth_retry(qc))
+		else if (ata_eh_worth_retry(qc))
 			qc->flags |= ATA_QCFLAG_RETRY;
 
 		/* accumulate error info */
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/char/random.c linux-libre-3.18.118-gnu/drivers/char/random.c
--- linux-libre-3.18.117-gnu/drivers/char/random.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/char/random.c	2018-08-09 06:20:36.000000000 -0400
@@ -1417,14 +1417,22 @@ static int
 write_pool(struct entropy_store *r, const char __user *buffer, size_t count)
 {
 	size_t bytes;
-	__u32 buf[16];
+	__u32 t, buf[16];
 	const char __user *p = buffer;
 
 	while (count > 0) {
+		int b, i = 0;
+
 		bytes = min(count, sizeof(buf));
 		if (copy_from_user(&buf, p, bytes))
 			return -EFAULT;
 
+		for (b = bytes ; b > 0 ; b -= sizeof(__u32), i++) {
+			if (!arch_get_random_int(&t))
+				break;
+			buf[i] ^= t;
+		}
+
 		count -= bytes;
 		p += bytes;
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/crypto/padlock-aes.c linux-libre-3.18.118-gnu/drivers/crypto/padlock-aes.c
--- linux-libre-3.18.117-gnu/drivers/crypto/padlock-aes.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/crypto/padlock-aes.c	2018-08-09 06:20:36.000000000 -0400
@@ -266,6 +266,8 @@ static inline void padlock_xcrypt_ecb(co
 		return;
 	}
 
+	count -= initial;
+
 	if (initial)
 		asm volatile (".byte 0xf3,0x0f,0xa7,0xc8"	/* rep xcryptecb */
 			      : "+S"(input), "+D"(output)
@@ -273,7 +275,7 @@ static inline void padlock_xcrypt_ecb(co
 
 	asm volatile (".byte 0xf3,0x0f,0xa7,0xc8"	/* rep xcryptecb */
 		      : "+S"(input), "+D"(output)
-		      : "d"(control_word), "b"(key), "c"(count - initial));
+		      : "d"(control_word), "b"(key), "c"(count));
 }
 
 static inline u8 *padlock_xcrypt_cbc(const u8 *input, u8 *output, void *key,
@@ -284,6 +286,8 @@ static inline u8 *padlock_xcrypt_cbc(con
 	if (count < cbc_fetch_blocks)
 		return cbc_crypt(input, output, key, iv, control_word, count);
 
+	count -= initial;
+
 	if (initial)
 		asm volatile (".byte 0xf3,0x0f,0xa7,0xd0"	/* rep xcryptcbc */
 			      : "+S" (input), "+D" (output), "+a" (iv)
@@ -291,7 +295,7 @@ static inline u8 *padlock_xcrypt_cbc(con
 
 	asm volatile (".byte 0xf3,0x0f,0xa7,0xd0"	/* rep xcryptcbc */
 		      : "+S" (input), "+D" (output), "+a" (iv)
-		      : "d" (control_word), "b" (key), "c" (count-initial));
+		      : "d" (control_word), "b" (key), "c" (count));
 	return iv;
 }
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/gpu/drm/gma500/psb_intel_drv.h linux-libre-3.18.118-gnu/drivers/gpu/drm/gma500/psb_intel_drv.h
--- linux-libre-3.18.117-gnu/drivers/gpu/drm/gma500/psb_intel_drv.h	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/gpu/drm/gma500/psb_intel_drv.h	2018-08-09 06:20:36.000000000 -0400
@@ -251,7 +251,7 @@ extern int intelfb_remove(struct drm_dev
 extern bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder,
 				      const struct drm_display_mode *mode,
 				      struct drm_display_mode *adjusted_mode);
-extern int psb_intel_lvds_mode_valid(struct drm_connector *connector,
+extern enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector,
 				     struct drm_display_mode *mode);
 extern int psb_intel_lvds_set_property(struct drm_connector *connector,
 					struct drm_property *property,
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/gpu/drm/gma500/psb_intel_lvds.c linux-libre-3.18.118-gnu/drivers/gpu/drm/gma500/psb_intel_lvds.c
--- linux-libre-3.18.117-gnu/drivers/gpu/drm/gma500/psb_intel_lvds.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/gpu/drm/gma500/psb_intel_lvds.c	2018-08-09 06:20:36.000000000 -0400
@@ -343,7 +343,7 @@ static void psb_intel_lvds_restore(struc
 	}
 }
 
-int psb_intel_lvds_mode_valid(struct drm_connector *connector,
+enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector,
 				 struct drm_display_mode *mode)
 {
 	struct drm_psb_private *dev_priv = connector->dev->dev_private;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/gpu/drm/radeon/radeon_connectors.c linux-libre-3.18.118-gnu/drivers/gpu/drm/radeon/radeon_connectors.c
--- linux-libre-3.18.117-gnu/drivers/gpu/drm/radeon/radeon_connectors.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/gpu/drm/radeon/radeon_connectors.c	2018-08-09 06:20:36.000000000 -0400
@@ -804,7 +804,7 @@ static int radeon_lvds_get_modes(struct
 	return ret;
 }
 
-static int radeon_lvds_mode_valid(struct drm_connector *connector,
+static enum drm_mode_status radeon_lvds_mode_valid(struct drm_connector *connector,
 				  struct drm_display_mode *mode)
 {
 	struct drm_encoder *encoder = radeon_best_single_encoder(connector);
@@ -947,7 +947,7 @@ static int radeon_vga_get_modes(struct d
 	return ret;
 }
 
-static int radeon_vga_mode_valid(struct drm_connector *connector,
+static enum drm_mode_status radeon_vga_mode_valid(struct drm_connector *connector,
 				  struct drm_display_mode *mode)
 {
 	struct drm_device *dev = connector->dev;
@@ -1086,7 +1086,7 @@ static int radeon_tv_get_modes(struct dr
 	return 1;
 }
 
-static int radeon_tv_mode_valid(struct drm_connector *connector,
+static enum drm_mode_status radeon_tv_mode_valid(struct drm_connector *connector,
 				struct drm_display_mode *mode)
 {
 	if ((mode->hdisplay > 1024) || (mode->vdisplay > 768))
@@ -1387,7 +1387,7 @@ static void radeon_dvi_force(struct drm_
 		radeon_connector->use_digital = true;
 }
 
-static int radeon_dvi_mode_valid(struct drm_connector *connector,
+static enum drm_mode_status radeon_dvi_mode_valid(struct drm_connector *connector,
 				  struct drm_display_mode *mode)
 {
 	struct drm_device *dev = connector->dev;
@@ -1666,7 +1666,7 @@ out:
 	return ret;
 }
 
-static int radeon_dp_mode_valid(struct drm_connector *connector,
+static enum drm_mode_status radeon_dp_mode_valid(struct drm_connector *connector,
 				  struct drm_display_mode *mode)
 {
 	struct drm_device *dev = connector->dev;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/hid/i2c-hid/i2c-hid.c linux-libre-3.18.118-gnu/drivers/hid/i2c-hid/i2c-hid.c
--- linux-libre-3.18.117-gnu/drivers/hid/i2c-hid/i2c-hid.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/hid/i2c-hid/i2c-hid.c	2018-08-09 06:20:36.000000000 -0400
@@ -981,6 +981,14 @@ static int i2c_hid_probe(struct i2c_clie
 	pm_runtime_set_active(&client->dev);
 	pm_runtime_enable(&client->dev);
 
+	/* Make sure there is something at this address */
+	ret = i2c_smbus_read_byte(client);
+	if (ret < 0) {
+		dev_dbg(&client->dev, "nothing at this address: %d\n", ret);
+		ret = -ENXIO;
+		goto err_pm;
+	}
+
 	ret = i2c_hid_fetch_hid_descriptor(ihid);
 	if (ret < 0)
 		goto err_pm;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/infiniband/core/mad.c linux-libre-3.18.118-gnu/drivers/infiniband/core/mad.c
--- linux-libre-3.18.117-gnu/drivers/infiniband/core/mad.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/infiniband/core/mad.c	2018-08-09 06:20:36.000000000 -0400
@@ -1466,7 +1466,8 @@ static int add_oui_reg_req(struct ib_mad
 			    mad_reg_req->oui, 3)) {
 			method = &(*vendor_table)->vendor_class[
 						vclass]->method_table[i];
-			BUG_ON(!*method);
+			if (!*method)
+				goto error3;
 			goto check_in_use;
 		}
 	}
@@ -1476,10 +1477,12 @@ static int add_oui_reg_req(struct ib_mad
 				vclass]->oui[i])) {
 			method = &(*vendor_table)->vendor_class[
 				vclass]->method_table[i];
-			BUG_ON(*method);
 			/* Allocate method table for this OUI */
-			if ((ret = allocate_method_table(method)))
-				goto error3;
+			if (!*method) {
+				ret = allocate_method_table(method);
+				if (ret)
+					goto error3;
+			}
 			memcpy((*vendor_table)->vendor_class[vclass]->oui[i],
 			       mad_reg_req->oui, 3);
 			goto check_in_use;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/infiniband/core/ucma.c linux-libre-3.18.118-gnu/drivers/infiniband/core/ucma.c
--- linux-libre-3.18.117-gnu/drivers/infiniband/core/ucma.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/infiniband/core/ucma.c	2018-08-09 06:20:36.000000000 -0400
@@ -180,7 +180,7 @@ static struct ucma_multicast* ucma_alloc
 		return NULL;
 
 	mutex_lock(&mut);
-	mc->id = idr_alloc(&multicast_idr, mc, 0, 0, GFP_KERNEL);
+	mc->id = idr_alloc(&multicast_idr, NULL, 0, 0, GFP_KERNEL);
 	mutex_unlock(&mut);
 	if (mc->id < 0)
 		goto error;
@@ -1262,6 +1262,10 @@ static ssize_t ucma_process_join(struct
 		goto err3;
 	}
 
+	mutex_lock(&mut);
+	idr_replace(&multicast_idr, mc, mc->id);
+	mutex_unlock(&mut);
+
 	mutex_unlock(&file->mut);
 	ucma_put_ctx(ctx);
 	return 0;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/md/md.c linux-libre-3.18.118-gnu/drivers/md/md.c
--- linux-libre-3.18.117-gnu/drivers/md/md.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/md/md.c	2018-08-09 06:20:36.000000000 -0400
@@ -5676,6 +5676,9 @@ static int hot_remove_disk(struct mddev
 	char b[BDEVNAME_SIZE];
 	struct md_rdev *rdev;
 
+	if (!mddev->pers)
+		return -ENODEV;
+
 	rdev = find_rdev(mddev, dev);
 	if (!rdev)
 		return -ENXIO;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/media/common/siano/smsendian.c linux-libre-3.18.118-gnu/drivers/media/common/siano/smsendian.c
--- linux-libre-3.18.117-gnu/drivers/media/common/siano/smsendian.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/media/common/siano/smsendian.c	2018-08-09 06:20:36.000000000 -0400
@@ -35,7 +35,7 @@ void smsendian_handle_tx_message(void *b
 	switch (msg->x_msg_header.msg_type) {
 	case MSG_SMS_DATA_DOWNLOAD_REQ:
 	{
-		msg->msg_data[0] = le32_to_cpu(msg->msg_data[0]);
+		msg->msg_data[0] = le32_to_cpu((__force __le32)(msg->msg_data[0]));
 		break;
 	}
 
@@ -44,7 +44,7 @@ void smsendian_handle_tx_message(void *b
 				sizeof(struct sms_msg_hdr))/4;
 
 		for (i = 0; i < msg_words; i++)
-			msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]);
+			msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]);
 
 		break;
 	}
@@ -64,7 +64,7 @@ void smsendian_handle_rx_message(void *b
 	{
 		struct sms_version_res *ver =
 			(struct sms_version_res *) msg;
-		ver->chip_model = le16_to_cpu(ver->chip_model);
+		ver->chip_model = le16_to_cpu((__force __le16)ver->chip_model);
 		break;
 	}
 
@@ -81,7 +81,7 @@ void smsendian_handle_rx_message(void *b
 				sizeof(struct sms_msg_hdr))/4;
 
 		for (i = 0; i < msg_words; i++)
-			msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]);
+			msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]);
 
 		break;
 	}
@@ -95,9 +95,9 @@ void smsendian_handle_message_header(voi
 #ifdef __BIG_ENDIAN
 	struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)msg;
 
-	phdr->msg_type = le16_to_cpu(phdr->msg_type);
-	phdr->msg_length = le16_to_cpu(phdr->msg_length);
-	phdr->msg_flags = le16_to_cpu(phdr->msg_flags);
+	phdr->msg_type = le16_to_cpu((__force __le16)phdr->msg_type);
+	phdr->msg_length = le16_to_cpu((__force __le16)phdr->msg_length);
+	phdr->msg_flags = le16_to_cpu((__force __le16)phdr->msg_flags);
 #endif /* __BIG_ENDIAN */
 }
 EXPORT_SYMBOL_GPL(smsendian_handle_message_header);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/media/i2c/smiapp/smiapp-core.c linux-libre-3.18.118-gnu/drivers/media/i2c/smiapp/smiapp-core.c
--- linux-libre-3.18.117-gnu/drivers/media/i2c/smiapp/smiapp-core.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/media/i2c/smiapp/smiapp-core.c	2018-08-09 06:20:36.000000000 -0400
@@ -939,7 +939,7 @@ static int smiapp_read_nvm(struct smiapp
 		if (rval)
 			goto out;
 
-		for (i = 0; i < 1000; i++) {
+		for (i = 1000; i > 0; i--) {
 			rval = smiapp_read(
 				sensor,
 				SMIAPP_REG_U8_DATA_TRANSFER_IF_1_STATUS, &s);
@@ -950,11 +950,10 @@ static int smiapp_read_nvm(struct smiapp
 			if (s & SMIAPP_DATA_TRANSFER_IF_1_STATUS_RD_READY)
 				break;
 
-			if (--i == 0) {
-				rval = -ETIMEDOUT;
-				goto out;
-			}
-
+		}
+		if (!i) {
+			rval = -ETIMEDOUT;
+			goto out;
 		}
 
 		for (i = 0; i < SMIAPP_NVM_PAGE_SIZE; i++) {
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/media/pci/saa7164/saa7164-fw.c linux-libre-3.18.118-gnu/drivers/media/pci/saa7164/saa7164-fw.c
--- linux-libre-3.18.117-gnu/drivers/media/pci/saa7164/saa7164-fw.c	2018-07-28 07:31:15.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/media/pci/saa7164/saa7164-fw.c	2018-08-09 11:09:38.000000000 -0400
@@ -430,7 +430,8 @@ int saa7164_downloadfirmware(struct saa7
 			__func__, fw->size);
 
 		if (fw->size != fwlength) {
-			printk(KERN_ERR "xc5000: firmware incorrect size\n");
+			printk(KERN_ERR "saa7164: firmware incorrect size %zu != %u\n",
+				fw->size, fwlength);
 			ret = -ENOMEM;
 			goto out;
 		}
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/media/platform/omap3isp/isp.c linux-libre-3.18.118-gnu/drivers/media/platform/omap3isp/isp.c
--- linux-libre-3.18.117-gnu/drivers/media/platform/omap3isp/isp.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/media/platform/omap3isp/isp.c	2018-08-09 06:20:36.000000000 -0400
@@ -2117,6 +2117,7 @@ error_csiphy:
 
 static void isp_detach_iommu(struct isp_device *isp)
 {
+	arm_iommu_detach_device(isp->dev);
 	arm_iommu_release_mapping(isp->mapping);
 	isp->mapping = NULL;
 	iommu_group_remove_device(isp->dev);
@@ -2150,8 +2151,7 @@ static int isp_attach_iommu(struct isp_d
 	mapping = arm_iommu_create_mapping(&platform_bus_type, SZ_1G, SZ_2G);
 	if (IS_ERR(mapping)) {
 		dev_err(isp->dev, "failed to create ARM IOMMU mapping\n");
-		ret = PTR_ERR(mapping);
-		goto error;
+		return PTR_ERR(mapping);
 	}
 
 	isp->mapping = mapping;
@@ -2166,7 +2166,8 @@ static int isp_attach_iommu(struct isp_d
 	return 0;
 
 error:
-	isp_detach_iommu(isp);
+	arm_iommu_release_mapping(isp->mapping);
+	isp->mapping = NULL;
 	return ret;
 }
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/media/radio/si470x/radio-si470x-i2c.c linux-libre-3.18.118-gnu/drivers/media/radio/si470x/radio-si470x-i2c.c
--- linux-libre-3.18.117-gnu/drivers/media/radio/si470x/radio-si470x-i2c.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/media/radio/si470x/radio-si470x-i2c.c	2018-08-09 06:20:36.000000000 -0400
@@ -96,7 +96,7 @@ MODULE_PARM_DESC(max_rds_errors, "RDS ma
  */
 int si470x_get_register(struct si470x_device *radio, int regnr)
 {
-	u16 buf[READ_REG_NUM];
+	__be16 buf[READ_REG_NUM];
 	struct i2c_msg msgs[1] = {
 		{
 			.addr = radio->client->addr,
@@ -121,7 +121,7 @@ int si470x_get_register(struct si470x_de
 int si470x_set_register(struct si470x_device *radio, int regnr)
 {
 	int i;
-	u16 buf[WRITE_REG_NUM];
+	__be16 buf[WRITE_REG_NUM];
 	struct i2c_msg msgs[1] = {
 		{
 			.addr = radio->client->addr,
@@ -151,7 +151,7 @@ int si470x_set_register(struct si470x_de
 static int si470x_get_all_registers(struct si470x_device *radio)
 {
 	int i;
-	u16 buf[READ_REG_NUM];
+	__be16 buf[READ_REG_NUM];
 	struct i2c_msg msgs[1] = {
 		{
 			.addr = radio->client->addr,
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/net/can/usb/ems_usb.c linux-libre-3.18.118-gnu/drivers/net/can/usb/ems_usb.c
--- linux-libre-3.18.117-gnu/drivers/net/can/usb/ems_usb.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/net/can/usb/ems_usb.c	2018-08-09 06:20:36.000000000 -0400
@@ -1083,6 +1083,7 @@ static void ems_usb_disconnect(struct us
 		usb_free_urb(dev->intr_urb);
 
 		kfree(dev->intr_in_buffer);
+		kfree(dev->tx_msg_buffer);
 	}
 }
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c linux-libre-3.18.118-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
--- linux-libre-3.18.117-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c	2018-08-09 06:20:36.000000000 -0400
@@ -53,7 +53,7 @@
 #include "stmmac.h"
 #include <linux/reset.h>
 
-#define STMMAC_ALIGN(x)	L1_CACHE_ALIGN(x)
+#define	STMMAC_ALIGN(x)		__ALIGN_KERNEL(x, SMP_CACHE_BYTES)
 
 /* Module parameters */
 #define TX_TIMEO	5000
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/net/wireless/ath/regd_common.h linux-libre-3.18.118-gnu/drivers/net/wireless/ath/regd_common.h
--- linux-libre-3.18.117-gnu/drivers/net/wireless/ath/regd_common.h	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/net/wireless/ath/regd_common.h	2018-08-09 06:20:36.000000000 -0400
@@ -35,6 +35,7 @@ enum EnumRd {
 	FRANCE_RES = 0x31,
 	FCC3_FCCA = 0x3A,
 	FCC3_WORLD = 0x3B,
+	FCC3_ETSIC = 0x3F,
 
 	ETSI1_WORLD = 0x37,
 	ETSI3_ETSIA = 0x32,
@@ -44,6 +45,7 @@ enum EnumRd {
 	ETSI4_ETSIC = 0x38,
 	ETSI5_WORLD = 0x39,
 	ETSI6_WORLD = 0x34,
+	ETSI8_WORLD = 0x3D,
 	ETSI_RESERVED = 0x33,
 
 	MKK1_MKKA = 0x40,
@@ -59,6 +61,7 @@ enum EnumRd {
 	MKK1_MKKA1 = 0x4A,
 	MKK1_MKKA2 = 0x4B,
 	MKK1_MKKC = 0x4C,
+	APL2_FCCA = 0x4D,
 
 	APL3_FCCA = 0x50,
 	APL1_WORLD = 0x52,
@@ -67,6 +70,7 @@ enum EnumRd {
 	APL1_ETSIC = 0x55,
 	APL2_ETSIC = 0x56,
 	APL5_WORLD = 0x58,
+	APL13_WORLD = 0x5A,
 	APL6_WORLD = 0x5B,
 	APL7_FCCA = 0x5C,
 	APL8_WORLD = 0x5D,
@@ -168,6 +172,7 @@ static struct reg_dmn_pair_mapping regDo
 	{FCC2_ETSIC, CTL_FCC, CTL_ETSI},
 	{FCC3_FCCA, CTL_FCC, CTL_FCC},
 	{FCC3_WORLD, CTL_FCC, CTL_ETSI},
+	{FCC3_ETSIC, CTL_FCC, CTL_ETSI},
 	{FCC4_FCCA, CTL_FCC, CTL_FCC},
 	{FCC5_FCCA, CTL_FCC, CTL_FCC},
 	{FCC6_FCCA, CTL_FCC, CTL_FCC},
@@ -179,6 +184,7 @@ static struct reg_dmn_pair_mapping regDo
 	{ETSI4_WORLD, CTL_ETSI, CTL_ETSI},
 	{ETSI5_WORLD, CTL_ETSI, CTL_ETSI},
 	{ETSI6_WORLD, CTL_ETSI, CTL_ETSI},
+	{ETSI8_WORLD, CTL_ETSI, CTL_ETSI},
 
 	/* XXX: For ETSI3_ETSIA, Was NO_CTL meant for the 2 GHz band ? */
 	{ETSI3_ETSIA, CTL_ETSI, CTL_ETSI},
@@ -188,9 +194,11 @@ static struct reg_dmn_pair_mapping regDo
 	{FCC1_FCCA, CTL_FCC, CTL_FCC},
 	{APL1_WORLD, CTL_FCC, CTL_ETSI},
 	{APL2_WORLD, CTL_FCC, CTL_ETSI},
+	{APL2_FCCA, CTL_FCC, CTL_FCC},
 	{APL3_WORLD, CTL_FCC, CTL_ETSI},
 	{APL4_WORLD, CTL_FCC, CTL_ETSI},
 	{APL5_WORLD, CTL_FCC, CTL_ETSI},
+	{APL13_WORLD, CTL_ETSI, CTL_ETSI},
 	{APL6_WORLD, CTL_ETSI, CTL_ETSI},
 	{APL8_WORLD, CTL_ETSI, CTL_ETSI},
 	{APL9_WORLD, CTL_ETSI, CTL_ETSI},
@@ -298,6 +306,7 @@ static struct country_code_to_enum_rd al
 	{CTRY_AUSTRALIA2, FCC6_WORLD, "AU"},
 	{CTRY_AUSTRIA, ETSI1_WORLD, "AT"},
 	{CTRY_AZERBAIJAN, ETSI4_WORLD, "AZ"},
+	{CTRY_BAHAMAS, FCC3_WORLD, "BS"},
 	{CTRY_BAHRAIN, APL6_WORLD, "BH"},
 	{CTRY_BANGLADESH, NULL1_WORLD, "BD"},
 	{CTRY_BARBADOS, FCC2_WORLD, "BB"},
@@ -305,6 +314,7 @@ static struct country_code_to_enum_rd al
 	{CTRY_BELGIUM, ETSI1_WORLD, "BE"},
 	{CTRY_BELGIUM2, ETSI4_WORLD, "BL"},
 	{CTRY_BELIZE, APL1_ETSIC, "BZ"},
+	{CTRY_BERMUDA, FCC3_FCCA, "BM"},
 	{CTRY_BOLIVIA, APL1_ETSIC, "BO"},
 	{CTRY_BOSNIA_HERZ, ETSI1_WORLD, "BA"},
 	{CTRY_BRAZIL, FCC3_WORLD, "BR"},
@@ -444,6 +454,7 @@ static struct country_code_to_enum_rd al
 	{CTRY_ROMANIA, NULL1_WORLD, "RO"},
 	{CTRY_RUSSIA, NULL1_WORLD, "RU"},
 	{CTRY_SAUDI_ARABIA, NULL1_WORLD, "SA"},
+	{CTRY_SERBIA, ETSI1_WORLD, "RS"},
 	{CTRY_SERBIA_MONTENEGRO, ETSI1_WORLD, "CS"},
 	{CTRY_SINGAPORE, APL6_WORLD, "SG"},
 	{CTRY_SLOVAKIA, ETSI1_WORLD, "SK"},
@@ -455,10 +466,12 @@ static struct country_code_to_enum_rd al
 	{CTRY_SWITZERLAND, ETSI1_WORLD, "CH"},
 	{CTRY_SYRIA, NULL1_WORLD, "SY"},
 	{CTRY_TAIWAN, APL3_FCCA, "TW"},
+	{CTRY_TANZANIA, APL1_WORLD, "TZ"},
 	{CTRY_THAILAND, FCC3_WORLD, "TH"},
 	{CTRY_TRINIDAD_Y_TOBAGO, FCC3_WORLD, "TT"},
 	{CTRY_TUNISIA, ETSI3_WORLD, "TN"},
 	{CTRY_TURKEY, ETSI3_WORLD, "TR"},
+	{CTRY_UGANDA, FCC3_WORLD, "UG"},
 	{CTRY_UKRAINE, NULL1_WORLD, "UA"},
 	{CTRY_UAE, NULL1_WORLD, "AE"},
 	{CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"},
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/net/wireless/ath/regd.h linux-libre-3.18.118-gnu/drivers/net/wireless/ath/regd.h
--- linux-libre-3.18.117-gnu/drivers/net/wireless/ath/regd.h	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/net/wireless/ath/regd.h	2018-08-09 06:20:36.000000000 -0400
@@ -68,12 +68,14 @@ enum CountryCode {
 	CTRY_AUSTRALIA = 36,
 	CTRY_AUSTRIA = 40,
 	CTRY_AZERBAIJAN = 31,
+	CTRY_BAHAMAS = 44,
 	CTRY_BAHRAIN = 48,
 	CTRY_BANGLADESH = 50,
 	CTRY_BARBADOS = 52,
 	CTRY_BELARUS = 112,
 	CTRY_BELGIUM = 56,
 	CTRY_BELIZE = 84,
+	CTRY_BERMUDA = 60,
 	CTRY_BOLIVIA = 68,
 	CTRY_BOSNIA_HERZ = 70,
 	CTRY_BRAZIL = 76,
@@ -159,6 +161,7 @@ enum CountryCode {
 	CTRY_ROMANIA = 642,
 	CTRY_RUSSIA = 643,
 	CTRY_SAUDI_ARABIA = 682,
+	CTRY_SERBIA = 688,
 	CTRY_SERBIA_MONTENEGRO = 891,
 	CTRY_SINGAPORE = 702,
 	CTRY_SLOVAKIA = 703,
@@ -170,11 +173,13 @@ enum CountryCode {
 	CTRY_SWITZERLAND = 756,
 	CTRY_SYRIA = 760,
 	CTRY_TAIWAN = 158,
+	CTRY_TANZANIA = 834,
 	CTRY_THAILAND = 764,
 	CTRY_TRINIDAD_Y_TOBAGO = 780,
 	CTRY_TUNISIA = 788,
 	CTRY_TURKEY = 792,
 	CTRY_UAE = 784,
+	CTRY_UGANDA = 800,
 	CTRY_UKRAINE = 804,
 	CTRY_UNITED_KINGDOM = 826,
 	CTRY_UNITED_STATES = 840,
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/net/wireless/mwifiex/usb.c linux-libre-3.18.118-gnu/drivers/net/wireless/mwifiex/usb.c
--- linux-libre-3.18.117-gnu/drivers/net/wireless/mwifiex/usb.c	2018-07-28 07:36:08.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/net/wireless/mwifiex/usb.c	2018-08-09 11:14:44.000000000 -0400
@@ -556,6 +556,9 @@ static void mwifiex_usb_disconnect(struc
 					 MWIFIEX_FUNC_SHUTDOWN);
 	}
 
+	if (adapter->workqueue)
+		flush_workqueue(adapter->workqueue);
+
 	mwifiex_usb_free(card);
 
 	dev_dbg(adapter->dev, "%s: removing card\n", __func__);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/net/wireless/rsi/rsi_91x_sdio.c linux-libre-3.18.118-gnu/drivers/net/wireless/rsi/rsi_91x_sdio.c
--- linux-libre-3.18.117-gnu/drivers/net/wireless/rsi/rsi_91x_sdio.c	2018-07-28 07:37:03.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/net/wireless/rsi/rsi_91x_sdio.c	2018-08-09 11:15:39.000000000 -0400
@@ -155,7 +155,6 @@ static void rsi_reset_card(struct sdio_f
 	int err;
 	struct mmc_card *card = pfunction->card;
 	struct mmc_host *host = card->host;
-	s32 bit = (fls(host->ocr_avail) - 1);
 	u8 cmd52_resp;
 	u32 clock, resp, i;
 	u16 rca;
@@ -175,7 +174,6 @@ static void rsi_reset_card(struct sdio_f
 	msleep(20);
 
 	/* Initialize the SDIO card */
-	host->ios.vdd = bit;
 	host->ios.chip_select = MMC_CS_DONTCARE;
 	host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
 	host->ios.power_mode = MMC_POWER_UP;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/net/wireless/ti/wlcore/sdio.c linux-libre-3.18.118-gnu/drivers/net/wireless/ti/wlcore/sdio.c
--- linux-libre-3.18.117-gnu/drivers/net/wireless/ti/wlcore/sdio.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/net/wireless/ti/wlcore/sdio.c	2018-08-09 06:20:36.000000000 -0400
@@ -342,6 +342,11 @@ static int wl1271_suspend(struct device
 	mmc_pm_flag_t sdio_flags;
 	int ret = 0;
 
+	if (!wl) {
+		dev_err(dev, "no wilink module was probed\n");
+		goto out;
+	}
+
 	dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n",
 		wl->wow_enabled);
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/net/xen-netfront.c linux-libre-3.18.118-gnu/drivers/net/xen-netfront.c
--- linux-libre-3.18.117-gnu/drivers/net/xen-netfront.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/net/xen-netfront.c	2018-08-09 06:20:36.000000000 -0400
@@ -85,6 +85,7 @@ struct netfront_cb {
 /* IRQ name is queue name with "-tx" or "-rx" appended */
 #define IRQ_NAME_SIZE (QUEUE_NAME_SIZE + 3)
 
+static DECLARE_WAIT_QUEUE_HEAD(module_load_q);
 static DECLARE_WAIT_QUEUE_HEAD(module_unload_q);
 
 struct netfront_stats {
@@ -1359,6 +1360,11 @@ static struct net_device *xennet_create_
 	netif_carrier_off(netdev);
 
 	xenbus_switch_state(dev, XenbusStateInitialising);
+	wait_event(module_load_q,
+			   xenbus_read_driver_state(dev->otherend) !=
+			   XenbusStateClosed &&
+			   xenbus_read_driver_state(dev->otherend) !=
+			   XenbusStateUnknown);
 	return netdev;
 
  exit:
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/pci/pci-sysfs.c linux-libre-3.18.118-gnu/drivers/pci/pci-sysfs.c
--- linux-libre-3.18.117-gnu/drivers/pci/pci-sysfs.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/pci/pci-sysfs.c	2018-08-09 06:20:36.000000000 -0400
@@ -199,13 +199,16 @@ static ssize_t enable_store(struct devic
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
-	if (!val) {
-		if (pci_is_enabled(pdev))
-			pci_disable_device(pdev);
-		else
-			result = -EIO;
-	} else
+	device_lock(dev);
+	if (dev->driver)
+		result = -EBUSY;
+	else if (val)
 		result = pci_enable_device(pdev);
+	else if (pci_is_enabled(pdev))
+		pci_disable_device(pdev);
+	else
+		result = -EIO;
+	device_unlock(dev);
 
 	return result < 0 ? result : count;
 }
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/regulator/pfuze100-regulator.c linux-libre-3.18.118-gnu/drivers/regulator/pfuze100-regulator.c
--- linux-libre-3.18.117-gnu/drivers/regulator/pfuze100-regulator.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/regulator/pfuze100-regulator.c	2018-08-09 06:20:36.000000000 -0400
@@ -142,6 +142,7 @@ static struct regulator_ops pfuze100_sw_
 static struct regulator_ops pfuze100_swb_regulator_ops = {
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
+	.is_enabled = regulator_is_enabled_regmap,
 	.list_voltage = regulator_list_voltage_table,
 	.map_voltage = regulator_map_voltage_ascend,
 	.set_voltage_sel = regulator_set_voltage_sel_regmap,
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/rtc/interface.c linux-libre-3.18.118-gnu/drivers/rtc/interface.c
--- linux-libre-3.18.117-gnu/drivers/rtc/interface.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/rtc/interface.c	2018-08-09 06:20:36.000000000 -0400
@@ -381,6 +381,11 @@ int rtc_set_alarm(struct rtc_device *rtc
 {
 	int err;
 
+	if (!rtc->ops)
+		return -ENODEV;
+	else if (!rtc->ops->set_alarm)
+		return -EINVAL;
+
 	err = rtc_valid_tm(&alarm->time);
 	if (err != 0)
 		return err;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/scsi/3w-9xxx.c linux-libre-3.18.118-gnu/drivers/scsi/3w-9xxx.c
--- linux-libre-3.18.117-gnu/drivers/scsi/3w-9xxx.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/scsi/3w-9xxx.c	2018-08-09 06:20:36.000000000 -0400
@@ -901,6 +901,11 @@ static int twa_chrdev_open(struct inode
 	unsigned int minor_number;
 	int retval = TW_IOCTL_ERROR_OS_ENODEV;
 
+	if (!capable(CAP_SYS_ADMIN)) {
+		retval = -EACCES;
+		goto out;
+	}
+
 	minor_number = iminor(inode);
 	if (minor_number >= twa_device_extension_count)
 		goto out;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/scsi/3w-xxxx.c linux-libre-3.18.118-gnu/drivers/scsi/3w-xxxx.c
--- linux-libre-3.18.117-gnu/drivers/scsi/3w-xxxx.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/scsi/3w-xxxx.c	2018-08-09 06:20:36.000000000 -0400
@@ -1047,6 +1047,9 @@ static int tw_chrdev_open(struct inode *
 
 	dprintk(KERN_WARNING "3w-xxxx: tw_ioctl_open()\n");
 
+	if (!capable(CAP_SYS_ADMIN))
+		return -EACCES;
+
 	minor_number = iminor(inode);
 	if (minor_number >= tw_device_extension_count)
 		return -ENODEV;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/scsi/megaraid.c linux-libre-3.18.118-gnu/drivers/scsi/megaraid.c
--- linux-libre-3.18.117-gnu/drivers/scsi/megaraid.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/scsi/megaraid.c	2018-08-09 06:20:36.000000000 -0400
@@ -4200,6 +4200,9 @@ megaraid_probe_one(struct pci_dev *pdev,
 	int irq, i, j;
 	int error = -ENODEV;
 
+	if (hba_count >= MAX_CONTROLLERS)
+		goto out;
+
 	if (pci_enable_device(pdev))
 		goto out;
 	pci_set_master(pdev);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/scsi/qla2xxx/qla_init.c linux-libre-3.18.118-gnu/drivers/scsi/qla2xxx/qla_init.c
--- linux-libre-3.18.117-gnu/drivers/scsi/qla2xxx/qla_init.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/scsi/qla2xxx/qla_init.c	2018-08-09 06:20:36.000000000 -0400
@@ -325,11 +325,10 @@ qla2x00_async_tm_cmd(fc_port_t *fcport,
 
 	wait_for_completion(&tm_iocb->u.tmf.comp);
 
-	rval = tm_iocb->u.tmf.comp_status == CS_COMPLETE ?
-	    QLA_SUCCESS : QLA_FUNCTION_FAILED;
+	rval = tm_iocb->u.tmf.data;
 
-	if ((rval != QLA_SUCCESS) || tm_iocb->u.tmf.data) {
-		ql_dbg(ql_dbg_taskm, vha, 0x8030,
+	if (rval != QLA_SUCCESS) {
+		ql_log(ql_log_warn, vha, 0x8030,
 		    "TM IOCB failed (%x).\n", rval);
 	}
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/scsi/qla2xxx/qla_os.c linux-libre-3.18.118-gnu/drivers/scsi/qla2xxx/qla_os.c
--- linux-libre-3.18.117-gnu/drivers/scsi/qla2xxx/qla_os.c	2018-07-28 07:40:36.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/scsi/qla2xxx/qla_os.c	2018-08-09 11:19:05.000000000 -0400
@@ -5000,8 +5000,9 @@ qla2x00_do_dpc(void *data)
 			}
 		}
 
-		if (test_and_clear_bit(ISP_ABORT_NEEDED,
-						&base_vha->dpc_flags)) {
+		if (test_and_clear_bit
+		    (ISP_ABORT_NEEDED, &base_vha->dpc_flags) &&
+		    !test_bit(UNLOADING, &base_vha->dpc_flags)) {
 
 			ql_dbg(ql_dbg_dpc, base_vha, 0x4007,
 			    "ISP abort scheduled.\n");
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/scsi/sg.c linux-libre-3.18.118-gnu/drivers/scsi/sg.c
--- linux-libre-3.18.117-gnu/drivers/scsi/sg.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/scsi/sg.c	2018-08-09 06:20:36.000000000 -0400
@@ -2242,6 +2242,7 @@ sg_add_sfp(Sg_device * sdp)
 	write_lock_irqsave(&sdp->sfd_lock, iflags);
 	if (atomic_read(&sdp->detaching)) {
 		write_unlock_irqrestore(&sdp->sfd_lock, iflags);
+		kfree(sfp);
 		return ERR_PTR(-ENODEV);
 	}
 	list_add_tail(&sfp->sfd_siblings, &sdp->sfds);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/scsi/ufs/ufshcd.c linux-libre-3.18.118-gnu/drivers/scsi/ufs/ufshcd.c
--- linux-libre-3.18.117-gnu/drivers/scsi/ufs/ufshcd.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/scsi/ufs/ufshcd.c	2018-08-09 06:20:36.000000000 -0400
@@ -3330,6 +3330,7 @@ static void ufshcd_exception_event_handl
 	hba = container_of(work, struct ufs_hba, eeh_work);
 
 	pm_runtime_get_sync(hba->dev);
+	scsi_block_requests(hba->host);
 	err = ufshcd_get_ee_status(hba, &status);
 	if (err) {
 		dev_err(hba->dev, "%s: failed to get exception status %d\n",
@@ -3345,6 +3346,7 @@ static void ufshcd_exception_event_handl
 					__func__, err);
 	}
 out:
+	scsi_unblock_requests(hba->host);
 	pm_runtime_put_sync(hba->dev);
 	return;
 }
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/tty/hvc/hvc_opal.c linux-libre-3.18.118-gnu/drivers/tty/hvc/hvc_opal.c
--- linux-libre-3.18.117-gnu/drivers/tty/hvc/hvc_opal.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/tty/hvc/hvc_opal.c	2018-08-09 06:20:36.000000000 -0400
@@ -337,7 +337,6 @@ static void udbg_init_opal_common(void)
 	udbg_putc = udbg_opal_putc;
 	udbg_getc = udbg_opal_getc;
 	udbg_getc_poll = udbg_opal_getc_poll;
-	tb_ticks_per_usec = 0x200; /* Make udelay not suck */
 }
 
 void __init hvc_opal_init_early(void)
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/tty/pty.c linux-libre-3.18.118-gnu/drivers/tty/pty.c
--- linux-libre-3.18.117-gnu/drivers/tty/pty.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/tty/pty.c	2018-08-09 06:20:36.000000000 -0400
@@ -114,16 +114,19 @@ static int pty_space(struct tty_struct *
 static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
 {
 	struct tty_struct *to = tty->link;
+	unsigned long flags;
 
 	if (tty->stopped)
 		return 0;
 
 	if (c > 0) {
+		spin_lock_irqsave(&to->port->lock, flags);
 		/* Stuff the data into the input queue of the other end */
 		c = tty_insert_flip_string(to->port, buf, c);
 		/* And shovel */
 		if (c)
 			tty_flip_buffer_push(to->port);
+		spin_unlock_irqrestore(&to->port->lock, flags);
 	}
 	return c;
 }
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/usb/core/hub.c linux-libre-3.18.118-gnu/drivers/usb/core/hub.c
--- linux-libre-3.18.117-gnu/drivers/usb/core/hub.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/usb/core/hub.c	2018-08-09 06:20:36.000000000 -0400
@@ -3310,6 +3310,10 @@ static int wait_for_ss_port_enable(struc
 	while (delay_ms < 2000) {
 		if (status || *portstatus & USB_PORT_STAT_CONNECTION)
 			break;
+		if (!port_is_power_on(hub, *portstatus)) {
+			status = -ENODEV;
+			break;
+		}
 		msleep(20);
 		delay_ms += 20;
 		status = hub_port_status(hub, *port1, portstatus, portchange);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/drivers/virtio/virtio_balloon.c linux-libre-3.18.118-gnu/drivers/virtio/virtio_balloon.c
--- linux-libre-3.18.117-gnu/drivers/virtio/virtio_balloon.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/drivers/virtio/virtio_balloon.c	2018-08-09 06:20:36.000000000 -0400
@@ -416,7 +416,9 @@ static int virtballoon_migratepage(struc
 	tell_host(vb, vb->inflate_vq);
 
 	/* balloon's page migration 2nd step -- deflate "page" */
+	spin_lock_irqsave(&vb_dev_info->pages_lock, flags);
 	balloon_page_delete(page);
+	spin_unlock_irqrestore(&vb_dev_info->pages_lock, flags);
 	vb->num_pfns = VIRTIO_BALLOON_PAGES_PER_PAGE;
 	set_page_pfns(vb->pfns, page);
 	tell_host(vb, vb->deflate_vq);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/fs/jfs/xattr.c linux-libre-3.18.118-gnu/fs/jfs/xattr.c
--- linux-libre-3.18.117-gnu/fs/jfs/xattr.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/fs/jfs/xattr.c	2018-08-09 06:20:36.000000000 -0400
@@ -493,15 +493,17 @@ static int ea_get(struct inode *inode, s
 	if (size > PSIZE) {
 		/*
 		 * To keep the rest of the code simple.  Allocate a
-		 * contiguous buffer to work with
+		 * contiguous buffer to work with. Make the buffer large
+		 * enough to make use of the whole extent.
 		 */
-		ea_buf->xattr = kmalloc(size, GFP_KERNEL);
+		ea_buf->max_size = (size + sb->s_blocksize - 1) &
+		    ~(sb->s_blocksize - 1);
+
+		ea_buf->xattr = kmalloc(ea_buf->max_size, GFP_KERNEL);
 		if (ea_buf->xattr == NULL)
 			return -ENOMEM;
 
 		ea_buf->flag = EA_MALLOC;
-		ea_buf->max_size = (size + sb->s_blocksize - 1) &
-		    ~(sb->s_blocksize - 1);
 
 		if (ea_size == 0)
 			return 0;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/fs/squashfs/block.c linux-libre-3.18.118-gnu/fs/squashfs/block.c
--- linux-libre-3.18.117-gnu/fs/squashfs/block.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/fs/squashfs/block.c	2018-08-09 06:20:36.000000000 -0400
@@ -166,6 +166,8 @@ int squashfs_read_data(struct super_bloc
 	}
 
 	if (compressed) {
+		if (!msblk->stream)
+			goto read_failure;
 		length = squashfs_decompress(msblk, bh, b, offset, length,
 			output);
 		if (length < 0)
diff -druNp --no-dereference linux-libre-3.18.117-gnu/fs/squashfs/cache.c linux-libre-3.18.118-gnu/fs/squashfs/cache.c
--- linux-libre-3.18.117-gnu/fs/squashfs/cache.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/fs/squashfs/cache.c	2018-08-09 06:20:36.000000000 -0400
@@ -350,6 +350,9 @@ int squashfs_read_metadata(struct super_
 
 	TRACE("Entered squashfs_read_metadata [%llx:%x]\n", *block, *offset);
 
+	if (unlikely(length < 0))
+		return -EIO;
+
 	while (length) {
 		entry = squashfs_cache_get(sb, msblk->block_cache, *block, 0);
 		if (entry->error) {
diff -druNp --no-dereference linux-libre-3.18.117-gnu/fs/squashfs/file.c linux-libre-3.18.118-gnu/fs/squashfs/file.c
--- linux-libre-3.18.117-gnu/fs/squashfs/file.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/fs/squashfs/file.c	2018-08-09 06:20:36.000000000 -0400
@@ -194,7 +194,11 @@ static long long read_indexes(struct sup
 		}
 
 		for (i = 0; i < blocks; i++) {
-			int size = le32_to_cpu(blist[i]);
+			int size = squashfs_block_size(blist[i]);
+			if (size < 0) {
+				err = size;
+				goto failure;
+			}
 			block += SQUASHFS_COMPRESSED_SIZE_BLOCK(size);
 		}
 		n -= blocks;
@@ -367,7 +371,7 @@ static int read_blocklist(struct inode *
 			sizeof(size));
 	if (res < 0)
 		return res;
-	return le32_to_cpu(size);
+	return squashfs_block_size(size);
 }
 
 /* Copy data into page cache  */
diff -druNp --no-dereference linux-libre-3.18.117-gnu/fs/squashfs/fragment.c linux-libre-3.18.118-gnu/fs/squashfs/fragment.c
--- linux-libre-3.18.117-gnu/fs/squashfs/fragment.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/fs/squashfs/fragment.c	2018-08-09 06:20:36.000000000 -0400
@@ -49,11 +49,16 @@ int squashfs_frag_lookup(struct super_bl
 				u64 *fragment_block)
 {
 	struct squashfs_sb_info *msblk = sb->s_fs_info;
-	int block = SQUASHFS_FRAGMENT_INDEX(fragment);
-	int offset = SQUASHFS_FRAGMENT_INDEX_OFFSET(fragment);
-	u64 start_block = le64_to_cpu(msblk->fragment_index[block]);
+	int block, offset, size;
 	struct squashfs_fragment_entry fragment_entry;
-	int size;
+	u64 start_block;
+
+	if (fragment >= msblk->fragments)
+		return -EIO;
+	block = SQUASHFS_FRAGMENT_INDEX(fragment);
+	offset = SQUASHFS_FRAGMENT_INDEX_OFFSET(fragment);
+
+	start_block = le64_to_cpu(msblk->fragment_index[block]);
 
 	size = squashfs_read_metadata(sb, &fragment_entry, &start_block,
 					&offset, sizeof(fragment_entry));
@@ -61,9 +66,7 @@ int squashfs_frag_lookup(struct super_bl
 		return size;
 
 	*fragment_block = le64_to_cpu(fragment_entry.start_block);
-	size = le32_to_cpu(fragment_entry.size);
-
-	return size;
+	return squashfs_block_size(fragment_entry.size);
 }
 
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/fs/squashfs/squashfs_fs.h linux-libre-3.18.118-gnu/fs/squashfs/squashfs_fs.h
--- linux-libre-3.18.117-gnu/fs/squashfs/squashfs_fs.h	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/fs/squashfs/squashfs_fs.h	2018-08-09 06:20:36.000000000 -0400
@@ -129,6 +129,12 @@
 
 #define SQUASHFS_COMPRESSED_BLOCK(B)	(!((B) & SQUASHFS_COMPRESSED_BIT_BLOCK))
 
+static inline int squashfs_block_size(__le32 raw)
+{
+	u32 size = le32_to_cpu(raw);
+	return (size >> 25) ? -EIO : size;
+}
+
 /*
  * Inode number ops.  Inodes consist of a compressed block number, and an
  * uncompressed offset within that block
diff -druNp --no-dereference linux-libre-3.18.117-gnu/fs/squashfs/squashfs_fs_sb.h linux-libre-3.18.118-gnu/fs/squashfs/squashfs_fs_sb.h
--- linux-libre-3.18.117-gnu/fs/squashfs/squashfs_fs_sb.h	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/fs/squashfs/squashfs_fs_sb.h	2018-08-09 06:20:36.000000000 -0400
@@ -75,6 +75,7 @@ struct squashfs_sb_info {
 	unsigned short				block_log;
 	long long				bytes_used;
 	unsigned int				inodes;
+	unsigned int				fragments;
 	int					xattr_ids;
 };
 #endif
diff -druNp --no-dereference linux-libre-3.18.117-gnu/fs/squashfs/super.c linux-libre-3.18.118-gnu/fs/squashfs/super.c
--- linux-libre-3.18.117-gnu/fs/squashfs/super.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/fs/squashfs/super.c	2018-08-09 06:20:36.000000000 -0400
@@ -176,6 +176,7 @@ static int squashfs_fill_super(struct su
 	msblk->inode_table = le64_to_cpu(sblk->inode_table_start);
 	msblk->directory_table = le64_to_cpu(sblk->directory_table_start);
 	msblk->inodes = le32_to_cpu(sblk->inodes);
+	msblk->fragments = le32_to_cpu(sblk->fragments);
 	flags = le16_to_cpu(sblk->flags);
 
 	TRACE("Found valid superblock on %s\n", bdevname(sb->s_bdev, b));
@@ -186,7 +187,7 @@ static int squashfs_fill_super(struct su
 	TRACE("Filesystem size %lld bytes\n", msblk->bytes_used);
 	TRACE("Block size %d\n", msblk->block_size);
 	TRACE("Number of inodes %d\n", msblk->inodes);
-	TRACE("Number of fragments %d\n", le32_to_cpu(sblk->fragments));
+	TRACE("Number of fragments %d\n", msblk->fragments);
 	TRACE("Number of ids %d\n", le16_to_cpu(sblk->no_ids));
 	TRACE("sblk->inode_table_start %llx\n", msblk->inode_table);
 	TRACE("sblk->directory_table_start %llx\n", msblk->directory_table);
@@ -273,7 +274,7 @@ allocate_id_index_table:
 	sb->s_export_op = &squashfs_export_ops;
 
 handle_fragments:
-	fragments = le32_to_cpu(sblk->fragments);
+	fragments = msblk->fragments;
 	if (fragments == 0)
 		goto check_directory_table;
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/include/linux/ring_buffer.h linux-libre-3.18.118-gnu/include/linux/ring_buffer.h
--- linux-libre-3.18.117-gnu/include/linux/ring_buffer.h	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/include/linux/ring_buffer.h	2018-08-09 06:20:36.000000000 -0400
@@ -162,6 +162,7 @@ void ring_buffer_record_enable(struct ri
 void ring_buffer_record_off(struct ring_buffer *buffer);
 void ring_buffer_record_on(struct ring_buffer *buffer);
 int ring_buffer_record_is_on(struct ring_buffer *buffer);
+int ring_buffer_record_is_set_on(struct ring_buffer *buffer);
 void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu);
 void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu);
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/include/net/tcp.h linux-libre-3.18.118-gnu/include/net/tcp.h
--- linux-libre-3.18.117-gnu/include/net/tcp.h	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/include/net/tcp.h	2018-08-09 06:20:36.000000000 -0400
@@ -372,7 +372,7 @@ ssize_t tcp_splice_read(struct socket *s
 			struct pipe_inode_info *pipe, size_t len,
 			unsigned int flags);
 
-void tcp_enter_quickack_mode(struct sock *sk);
+void tcp_enter_quickack_mode(struct sock *sk, unsigned int max_quickacks);
 static inline void tcp_dec_quickack_mode(struct sock *sk,
 					 const unsigned int pkts)
 {
diff -druNp --no-dereference linux-libre-3.18.117-gnu/kernel/bpf/verifier.c linux-libre-3.18.118-gnu/kernel/bpf/verifier.c
--- linux-libre-3.18.117-gnu/kernel/bpf/verifier.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/kernel/bpf/verifier.c	2018-08-09 06:20:36.000000000 -0400
@@ -1763,7 +1763,7 @@ static int replace_map_fd_with_map_ptr(s
 			/* hold the map. If the program is rejected by verifier,
 			 * the map will be released by release_maps() or it
 			 * will be used by the valid program until it's unloaded
-			 * and all maps are released in free_bpf_prog_info()
+			 * and all maps are released in free_used_maps()
 			 */
 			atomic_inc(&map->refcnt);
 
@@ -1929,7 +1929,7 @@ free_log_buf:
 free_env:
 	if (!prog->aux->used_maps)
 		/* if we didn't copy map pointers into bpf_prog_info, release
-		 * them now. Otherwise free_bpf_prog_info() will release them.
+		 * them now. Otherwise free_used_maps() will release them.
 		 */
 		release_maps(env);
 	kfree(env);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/kernel/trace/ring_buffer.c linux-libre-3.18.118-gnu/kernel/trace/ring_buffer.c
--- linux-libre-3.18.117-gnu/kernel/trace/ring_buffer.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/kernel/trace/ring_buffer.c	2018-08-09 06:20:36.000000000 -0400
@@ -3153,6 +3153,22 @@ int ring_buffer_record_is_on(struct ring
 }
 
 /**
+ * ring_buffer_record_is_set_on - return true if the ring buffer is set writable
+ * @buffer: The ring buffer to see if write is set enabled
+ *
+ * Returns true if the ring buffer is set writable by ring_buffer_record_on().
+ * Note that this does NOT mean it is in a writable state.
+ *
+ * It may return true when the ring buffer has been disabled by
+ * ring_buffer_record_disable(), as that is a temporary disabling of
+ * the ring buffer.
+ */
+int ring_buffer_record_is_set_on(struct ring_buffer *buffer)
+{
+	return !(atomic_read(&buffer->record_disabled) & RB_BUFFER_OFF);
+}
+
+/**
  * ring_buffer_record_disable_cpu - stop all writes into the cpu_buffer
  * @buffer: The ring buffer to stop writes to.
  * @cpu: The CPU buffer to stop
diff -druNp --no-dereference linux-libre-3.18.117-gnu/kernel/trace/trace.c linux-libre-3.18.118-gnu/kernel/trace/trace.c
--- linux-libre-3.18.117-gnu/kernel/trace/trace.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/kernel/trace/trace.c	2018-08-09 06:20:36.000000000 -0400
@@ -1023,6 +1023,12 @@ update_max_tr(struct trace_array *tr, st
 
 	arch_spin_lock(&tr->max_lock);
 
+	/* Inherit the recordable setting from trace_buffer */
+	if (ring_buffer_record_is_set_on(tr->trace_buffer.buffer))
+		ring_buffer_record_on(tr->max_buffer.buffer);
+	else
+		ring_buffer_record_off(tr->max_buffer.buffer);
+
 	buf = tr->trace_buffer.buffer;
 	tr->trace_buffer.buffer = tr->max_buffer.buffer;
 	tr->max_buffer.buffer = buf;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/kernel/trace/trace_events_trigger.c linux-libre-3.18.118-gnu/kernel/trace/trace_events_trigger.c
--- linux-libre-3.18.117-gnu/kernel/trace/trace_events_trigger.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/kernel/trace/trace_events_trigger.c	2018-08-09 06:20:36.000000000 -0400
@@ -663,6 +663,8 @@ event_trigger_callback(struct event_comm
 		goto out_free;
 
  out_reg:
+	/* Up the trigger_data count to make sure reg doesn't free it on failure */
+	event_trigger_init(trigger_ops, trigger_data);
 	ret = cmd_ops->reg(glob, trigger_ops, trigger_data, file);
 	/*
 	 * The above returns on success the # of functions enabled,
@@ -670,11 +672,13 @@ event_trigger_callback(struct event_comm
 	 * Consider no functions a failure too.
 	 */
 	if (!ret) {
+		cmd_ops->unreg(glob, trigger_ops, trigger_data, file);
 		ret = -ENOENT;
-		goto out_free;
-	} else if (ret < 0)
-		goto out_free;
-	ret = 0;
+	} else if (ret > 0)
+		ret = 0;
+
+	/* Down the counter of trigger_data or free it if not used anymore */
+	event_trigger_free(trigger_ops, trigger_data);
  out:
 	return ret;
 
@@ -1227,6 +1231,9 @@ event_enable_trigger_func(struct event_c
 		goto out;
 	}
 
+	/* Up the trigger_data count to make sure nothing frees it on failure */
+	event_trigger_init(trigger_ops, trigger_data);
+
 	if (trigger) {
 		number = strsep(&trigger, ":");
 
@@ -1277,6 +1284,7 @@ event_enable_trigger_func(struct event_c
 		goto out_disable;
 	/* Just return zero, not the number of enabled functions */
 	ret = 0;
+	event_trigger_free(trigger_ops, trigger_data);
  out:
 	return ret;
 
@@ -1287,7 +1295,7 @@ event_enable_trigger_func(struct event_c
  out_free:
 	if (cmd_ops->set_filter)
 		cmd_ops->set_filter(NULL, trigger_data, NULL);
-	kfree(trigger_data);
+	event_trigger_free(trigger_ops, trigger_data);
 	kfree(enable_data);
 	goto out;
 }
diff -druNp --no-dereference linux-libre-3.18.117-gnu/kernel/trace/trace_kprobe.c linux-libre-3.18.118-gnu/kernel/trace/trace_kprobe.c
--- linux-libre-3.18.117-gnu/kernel/trace/trace_kprobe.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/kernel/trace/trace_kprobe.c	2018-08-09 06:20:36.000000000 -0400
@@ -361,11 +361,10 @@ static struct trace_kprobe *find_trace_k
 static int
 enable_trace_kprobe(struct trace_kprobe *tk, struct ftrace_event_file *file)
 {
+	struct event_file_link *link = NULL;
 	int ret = 0;
 
 	if (file) {
-		struct event_file_link *link;
-
 		link = kmalloc(sizeof(*link), GFP_KERNEL);
 		if (!link) {
 			ret = -ENOMEM;
@@ -385,6 +384,18 @@ enable_trace_kprobe(struct trace_kprobe
 		else
 			ret = enable_kprobe(&tk->rp.kp);
 	}
+
+	if (ret) {
+		if (file) {
+			/* Notice the if is true on not WARN() */
+			if (!WARN_ON_ONCE(!link))
+				list_del_rcu(&link->list);
+			kfree(link);
+			tk->tp.flags &= ~TP_FLAG_TRACE;
+		} else {
+			tk->tp.flags &= ~TP_FLAG_PROFILE;
+		}
+	}
  out:
 	return ret;
 }
diff -druNp --no-dereference linux-libre-3.18.117-gnu/Makefile linux-libre-3.18.118-gnu/Makefile
--- linux-libre-3.18.117-gnu/Makefile	2018-07-28 07:21:17.000000000 -0400
+++ linux-libre-3.18.118-gnu/Makefile	2018-08-09 11:00:15.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 117
+SUBLEVEL = 118
 EXTRAVERSION =-gnu
 NAME = Diseased Newt
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/mm/slub.c linux-libre-3.18.118-gnu/mm/slub.c
--- linux-libre-3.18.117-gnu/mm/slub.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/mm/slub.c	2018-08-09 06:20:36.000000000 -0400
@@ -636,7 +636,7 @@ static void object_err(struct kmem_cache
 	print_trailer(s, page, object);
 }
 
-static void slab_err(struct kmem_cache *s, struct page *page,
+static __printf(3, 4) void slab_err(struct kmem_cache *s, struct page *page,
 			const char *fmt, ...)
 {
 	va_list args;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/mm/vmalloc.c linux-libre-3.18.118-gnu/mm/vmalloc.c
--- linux-libre-3.18.117-gnu/mm/vmalloc.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/mm/vmalloc.c	2018-08-09 06:20:36.000000000 -0400
@@ -1440,7 +1440,7 @@ static void __vunmap(const void *addr, i
 			addr))
 		return;
 
-	area = remove_vm_area(addr);
+	area = find_vmap_area((unsigned long)addr)->vm;
 	if (unlikely(!area)) {
 		WARN(1, KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n",
 				addr);
@@ -1450,6 +1450,7 @@ static void __vunmap(const void *addr, i
 	debug_check_no_locks_freed(addr, area->size);
 	debug_check_no_obj_freed(addr, area->size);
 
+	remove_vm_area(addr);
 	if (deallocate_pages) {
 		int i;
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/net/dsa/slave.c linux-libre-3.18.118-gnu/net/dsa/slave.c
--- linux-libre-3.18.117-gnu/net/dsa/slave.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/net/dsa/slave.c	2018-08-09 06:20:36.000000000 -0400
@@ -503,6 +503,9 @@ int dsa_slave_suspend(struct net_device
 {
 	struct dsa_slave_priv *p = netdev_priv(slave_dev);
 
+	if (!netif_running(slave_dev))
+		return 0;
+
 	netif_device_detach(slave_dev);
 
 	if (p->phy) {
@@ -520,6 +523,9 @@ int dsa_slave_resume(struct net_device *
 {
 	struct dsa_slave_priv *p = netdev_priv(slave_dev);
 
+	if (!netif_running(slave_dev))
+		return 0;
+
 	netif_device_attach(slave_dev);
 
 	if (p->phy) {
diff -druNp --no-dereference linux-libre-3.18.117-gnu/net/ipv4/fib_frontend.c linux-libre-3.18.118-gnu/net/ipv4/fib_frontend.c
--- linux-libre-3.18.117-gnu/net/ipv4/fib_frontend.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/net/ipv4/fib_frontend.c	2018-08-09 06:20:36.000000000 -0400
@@ -209,19 +209,19 @@ __be32 fib_compute_spec_dst(struct sk_bu
 		return ip_hdr(skb)->daddr;
 
 	in_dev = __in_dev_get_rcu(dev);
-	BUG_ON(!in_dev);
 
 	net = dev_net(dev);
 
 	scope = RT_SCOPE_UNIVERSE;
 	if (!ipv4_is_zeronet(ip_hdr(skb)->saddr)) {
+		bool vmark = in_dev && IN_DEV_SRC_VMARK(in_dev);
 		fl4.flowi4_oif = 0;
 		fl4.flowi4_iif = LOOPBACK_IFINDEX;
 		fl4.daddr = ip_hdr(skb)->saddr;
 		fl4.saddr = 0;
 		fl4.flowi4_tos = RT_TOS(ip_hdr(skb)->tos);
 		fl4.flowi4_scope = scope;
-		fl4.flowi4_mark = IN_DEV_SRC_VMARK(in_dev) ? skb->mark : 0;
+		fl4.flowi4_mark = vmark ? skb->mark : 0;
 		if (!fib_lookup(net, &fl4, &res))
 			return FIB_RES_PREFSRC(net, res);
 	} else {
diff -druNp --no-dereference linux-libre-3.18.117-gnu/net/ipv4/inet_fragment.c linux-libre-3.18.118-gnu/net/ipv4/inet_fragment.c
--- linux-libre-3.18.117-gnu/net/ipv4/inet_fragment.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/net/ipv4/inet_fragment.c	2018-08-09 06:20:36.000000000 -0400
@@ -379,11 +379,6 @@ static struct inet_frag_queue *inet_frag
 {
 	struct inet_frag_queue *q;
 
-	if (frag_mem_limit(nf) > nf->high_thresh) {
-		inet_frag_schedule_worker(f);
-		return NULL;
-	}
-
 	q = kmem_cache_zalloc(f->frags_cachep, GFP_ATOMIC);
 	if (q == NULL)
 		return NULL;
@@ -420,6 +415,11 @@ struct inet_frag_queue *inet_frag_find(s
 	struct inet_frag_queue *q;
 	int depth = 0;
 
+	if (!nf->high_thresh || frag_mem_limit(nf) > nf->high_thresh) {
+		inet_frag_schedule_worker(f);
+		return NULL;
+	}
+
 	if (frag_mem_limit(nf) > nf->low_thresh)
 		inet_frag_schedule_worker(f);
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/net/ipv4/ipconfig.c linux-libre-3.18.118-gnu/net/ipv4/ipconfig.c
--- linux-libre-3.18.117-gnu/net/ipv4/ipconfig.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/net/ipv4/ipconfig.c	2018-08-09 06:20:36.000000000 -0400
@@ -772,6 +772,11 @@ static void __init ic_bootp_init_ext(u8
  */
 static inline void __init ic_bootp_init(void)
 {
+	/* Re-initialise all name servers to NONE, in case any were set via the
+	 * "ip=" or "nfsaddrs=" kernel command line parameters: any IP addresses
+	 * specified there will already have been decoded but are no longer
+	 * needed
+	 */
 	ic_nameservers_predef();
 
 	dev_add_pack(&bootp_packet_type);
@@ -1404,6 +1409,13 @@ static int __init ip_auto_config(void)
 	int err;
 	unsigned int i;
 
+	/* Initialise all name servers to NONE (but only if the "ip=" or
+	 * "nfsaddrs=" kernel command line parameters weren't decoded, otherwise
+	 * we'll overwrite the IP addresses specified there)
+	 */
+	if (ic_set_manually == 0)
+		ic_nameservers_predef();
+
 #ifdef CONFIG_PROC_FS
 	proc_create("pnp", S_IRUGO, init_net.proc_net, &pnp_seq_fops);
 #endif /* CONFIG_PROC_FS */
@@ -1605,6 +1617,7 @@ static int __init ip_auto_config_setup(c
 		return 1;
 	}
 
+	/* Initialise all name servers to NONE */
 	ic_nameservers_predef();
 
 	/* Parse string for static IP assignment.  */
diff -druNp --no-dereference linux-libre-3.18.117-gnu/net/ipv4/tcp_dctcp.c linux-libre-3.18.118-gnu/net/ipv4/tcp_dctcp.c
--- linux-libre-3.18.117-gnu/net/ipv4/tcp_dctcp.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/net/ipv4/tcp_dctcp.c	2018-08-09 06:20:36.000000000 -0400
@@ -135,7 +135,7 @@ static void dctcp_ce_state_0_to_1(struct
 		 */
 		if (inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER)
 			__tcp_send_ack(sk, ca->prior_rcv_nxt);
-		tcp_enter_quickack_mode(sk);
+		tcp_enter_quickack_mode(sk, 1);
 	}
 
 	ca->prior_rcv_nxt = tp->rcv_nxt;
@@ -156,7 +156,7 @@ static void dctcp_ce_state_1_to_0(struct
 		 */
 		if (inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER)
 			__tcp_send_ack(sk, ca->prior_rcv_nxt);
-		tcp_enter_quickack_mode(sk);
+		tcp_enter_quickack_mode(sk, 1);
 	}
 
 	ca->prior_rcv_nxt = tp->rcv_nxt;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/net/ipv4/tcp_input.c linux-libre-3.18.118-gnu/net/ipv4/tcp_input.c
--- linux-libre-3.18.117-gnu/net/ipv4/tcp_input.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/net/ipv4/tcp_input.c	2018-08-09 06:20:36.000000000 -0400
@@ -171,21 +171,23 @@ static void tcp_measure_rcv_mss(struct s
 	}
 }
 
-static void tcp_incr_quickack(struct sock *sk)
+static void tcp_incr_quickack(struct sock *sk, unsigned int max_quickacks)
 {
 	struct inet_connection_sock *icsk = inet_csk(sk);
 	unsigned int quickacks = tcp_sk(sk)->rcv_wnd / (2 * icsk->icsk_ack.rcv_mss);
 
 	if (quickacks == 0)
 		quickacks = 2;
+	quickacks = min(quickacks, max_quickacks);
 	if (quickacks > icsk->icsk_ack.quick)
-		icsk->icsk_ack.quick = min(quickacks, TCP_MAX_QUICKACKS);
+		icsk->icsk_ack.quick = quickacks;
 }
 
-void tcp_enter_quickack_mode(struct sock *sk)
+void tcp_enter_quickack_mode(struct sock *sk, unsigned int max_quickacks)
 {
 	struct inet_connection_sock *icsk = inet_csk(sk);
-	tcp_incr_quickack(sk);
+
+	tcp_incr_quickack(sk, max_quickacks);
 	icsk->icsk_ack.pingpong = 0;
 	icsk->icsk_ack.ato = TCP_ATO_MIN;
 }
@@ -219,8 +221,10 @@ static void tcp_ecn_withdraw_cwr(struct
 	tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR;
 }
 
-static void __tcp_ecn_check_ce(struct tcp_sock *tp, const struct sk_buff *skb)
+static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb)
 {
+	struct tcp_sock *tp = tcp_sk(sk);
+
 	switch (TCP_SKB_CB(skb)->ip_dsfield & INET_ECN_MASK) {
 	case INET_ECN_NOT_ECT:
 		/* Funny extension: if ECT is not set on a segment,
@@ -228,31 +232,31 @@ static void __tcp_ecn_check_ce(struct tc
 		 * it is probably a retransmit.
 		 */
 		if (tp->ecn_flags & TCP_ECN_SEEN)
-			tcp_enter_quickack_mode((struct sock *)tp);
+			tcp_enter_quickack_mode(sk, 2);
 		break;
 	case INET_ECN_CE:
-		if (tcp_ca_needs_ecn((struct sock *)tp))
-			tcp_ca_event((struct sock *)tp, CA_EVENT_ECN_IS_CE);
+		if (tcp_ca_needs_ecn(sk))
+			tcp_ca_event(sk, CA_EVENT_ECN_IS_CE);
 
 		if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) {
 			/* Better not delay acks, sender can have a very low cwnd */
-			tcp_enter_quickack_mode((struct sock *)tp);
+			tcp_enter_quickack_mode(sk, 2);
 			tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
 		}
 		tp->ecn_flags |= TCP_ECN_SEEN;
 		break;
 	default:
-		if (tcp_ca_needs_ecn((struct sock *)tp))
-			tcp_ca_event((struct sock *)tp, CA_EVENT_ECN_NO_CE);
+		if (tcp_ca_needs_ecn(sk))
+			tcp_ca_event(sk, CA_EVENT_ECN_NO_CE);
 		tp->ecn_flags |= TCP_ECN_SEEN;
 		break;
 	}
 }
 
-static void tcp_ecn_check_ce(struct tcp_sock *tp, const struct sk_buff *skb)
+static void tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb)
 {
-	if (tp->ecn_flags & TCP_ECN_OK)
-		__tcp_ecn_check_ce(tp, skb);
+	if (tcp_sk(sk)->ecn_flags & TCP_ECN_OK)
+		__tcp_ecn_check_ce(sk, skb);
 }
 
 static void tcp_ecn_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th)
@@ -644,7 +648,7 @@ static void tcp_event_data_recv(struct s
 		/* The _first_ data packet received, initialize
 		 * delayed ACK engine.
 		 */
-		tcp_incr_quickack(sk);
+		tcp_incr_quickack(sk, TCP_MAX_QUICKACKS);
 		icsk->icsk_ack.ato = TCP_ATO_MIN;
 	} else {
 		int m = now - icsk->icsk_ack.lrcvtime;
@@ -660,13 +664,13 @@ static void tcp_event_data_recv(struct s
 			/* Too long gap. Apparently sender failed to
 			 * restart window, so that we send ACKs quickly.
 			 */
-			tcp_incr_quickack(sk);
+			tcp_incr_quickack(sk, TCP_MAX_QUICKACKS);
 			sk_mem_reclaim(sk);
 		}
 	}
 	icsk->icsk_ack.lrcvtime = now;
 
-	tcp_ecn_check_ce(tp, skb);
+	tcp_ecn_check_ce(sk, skb);
 
 	if (skb->len >= 128)
 		tcp_grow_window(sk, skb);
@@ -4001,7 +4005,7 @@ static void tcp_send_dupack(struct sock
 	if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
 	    before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
 		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOST);
-		tcp_enter_quickack_mode(sk);
+		tcp_enter_quickack_mode(sk, TCP_MAX_QUICKACKS);
 
 		if (tcp_is_sack(tp) && sysctl_tcp_dsack) {
 			u32 end_seq = TCP_SKB_CB(skb)->end_seq;
@@ -4229,7 +4233,7 @@ static void tcp_data_queue_ofo(struct so
 	struct sk_buff *skb1;
 	u32 seq, end_seq;
 
-	tcp_ecn_check_ce(tp, skb);
+	tcp_ecn_check_ce(sk, skb);
 
 	if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
 		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFODROP);
@@ -4501,7 +4505,7 @@ queue_and_out:
 		tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
 
 out_of_window:
-		tcp_enter_quickack_mode(sk);
+		tcp_enter_quickack_mode(sk, TCP_MAX_QUICKACKS);
 		inet_csk_schedule_ack(sk);
 drop:
 		__kfree_skb(skb);
@@ -4512,8 +4516,6 @@ drop:
 	if (!before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt + tcp_receive_window(tp)))
 		goto out_of_window;
 
-	tcp_enter_quickack_mode(sk);
-
 	if (before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
 		/* Partial packet, seq < rcv_next < end_seq */
 		SOCK_DEBUG(sk, "partial packet: rcv_next %X seq %X - %X\n",
@@ -5523,7 +5525,7 @@ static int tcp_rcv_synsent_state_process
 			 * to stand against the temptation 8)     --ANK
 			 */
 			inet_csk_schedule_ack(sk);
-			tcp_enter_quickack_mode(sk);
+			tcp_enter_quickack_mode(sk, TCP_MAX_QUICKACKS);
 			inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
 						  TCP_DELACK_MAX, TCP_RTO_MAX);
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/sound/pci/emu10k1/emupcm.c linux-libre-3.18.118-gnu/sound/pci/emu10k1/emupcm.c
--- linux-libre-3.18.117-gnu/sound/pci/emu10k1/emupcm.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/sound/pci/emu10k1/emupcm.c	2018-08-09 06:20:36.000000000 -0400
@@ -1875,7 +1875,9 @@ int snd_emu10k1_pcm_efx(struct snd_emu10
 	if (!kctl)
 		return -ENOMEM;
 	kctl->id.device = device;
-	snd_ctl_add(emu->card, kctl);
+	err = snd_ctl_add(emu->card, kctl);
+	if (err < 0)
+		return err;
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024);
 
diff -druNp --no-dereference linux-libre-3.18.117-gnu/sound/pci/emu10k1/memory.c linux-libre-3.18.118-gnu/sound/pci/emu10k1/memory.c
--- linux-libre-3.18.117-gnu/sound/pci/emu10k1/memory.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/sound/pci/emu10k1/memory.c	2018-08-09 06:20:36.000000000 -0400
@@ -237,13 +237,13 @@ __found_pages:
 static int is_valid_page(struct snd_emu10k1 *emu, dma_addr_t addr)
 {
 	if (addr & ~emu->dma_mask) {
-		dev_err(emu->card->dev,
+		dev_err_ratelimited(emu->card->dev,
 			"max memory size is 0x%lx (addr = 0x%lx)!!\n",
 			emu->dma_mask, (unsigned long)addr);
 		return 0;
 	}
 	if (addr & (EMUPAGESIZE-1)) {
-		dev_err(emu->card->dev, "page is not aligned\n");
+		dev_err_ratelimited(emu->card->dev, "page is not aligned\n");
 		return 0;
 	}
 	return 1;
@@ -334,7 +334,7 @@ snd_emu10k1_alloc_pages(struct snd_emu10
 		else
 			addr = snd_pcm_sgbuf_get_addr(substream, ofs);
 		if (! is_valid_page(emu, addr)) {
-			dev_err(emu->card->dev,
+			dev_err_ratelimited(emu->card->dev,
 				"emu: failure page = %d\n", idx);
 			mutex_unlock(&hdr->block_mutex);
 			return NULL;
diff -druNp --no-dereference linux-libre-3.18.117-gnu/sound/pci/fm801.c linux-libre-3.18.118-gnu/sound/pci/fm801.c
--- linux-libre-3.18.117-gnu/sound/pci/fm801.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/sound/pci/fm801.c	2018-08-09 06:20:36.000000000 -0400
@@ -1070,11 +1070,19 @@ static int snd_fm801_mixer(struct fm801
 		if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97_sec)) < 0)
 			return err;
 	}
-	for (i = 0; i < FM801_CONTROLS; i++)
-		snd_ctl_add(chip->card, snd_ctl_new1(&snd_fm801_controls[i], chip));
+	for (i = 0; i < FM801_CONTROLS; i++) {
+		err = snd_ctl_add(chip->card,
+			snd_ctl_new1(&snd_fm801_controls[i], chip));
+		if (err < 0)
+			return err;
+	}
 	if (chip->multichannel) {
-		for (i = 0; i < FM801_CONTROLS_MULTI; i++)
-			snd_ctl_add(chip->card, snd_ctl_new1(&snd_fm801_controls_multi[i], chip));
+		for (i = 0; i < FM801_CONTROLS_MULTI; i++) {
+			err = snd_ctl_add(chip->card,
+				snd_ctl_new1(&snd_fm801_controls_multi[i], chip));
+			if (err < 0)
+				return err;
+		}
 	}
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.117-gnu/sound/pci/hda/patch_ca0132.c linux-libre-3.18.118-gnu/sound/pci/hda/patch_ca0132.c
--- linux-libre-3.18.117-gnu/sound/pci/hda/patch_ca0132.c	2018-07-28 07:43:02.000000000 -0400
+++ linux-libre-3.18.118-gnu/sound/pci/hda/patch_ca0132.c	2018-08-09 11:21:28.000000000 -0400
@@ -38,6 +38,10 @@
 /* Enable this to see controls for tuning purpose. */
 /*#define ENABLE_TUNING_CONTROLS*/
 
+#ifdef ENABLE_TUNING_CONTROLS
+#include <sound/tlv.h>
+#endif
+
 #define FLOAT_ZERO	0x00000000
 #define FLOAT_ONE	0x3f800000
 #define FLOAT_TWO	0x40000000
@@ -3037,8 +3041,8 @@ static int equalizer_ctl_put(struct snd_
 	return 1;
 }
 
-static const DECLARE_TLV_DB_SCALE(voice_focus_db_scale, 2000, 100, 0);
-static const DECLARE_TLV_DB_SCALE(eq_db_scale, -2400, 100, 0);
+static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(voice_focus_db_scale, 2000, 100, 0);
+static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(eq_db_scale, -2400, 100, 0);
 
 static int add_tuning_control(struct hda_codec *codec,
 				hda_nid_t pnid, hda_nid_t nid,
diff -druNp --no-dereference linux-libre-3.18.117-gnu/sound/soc/soc-pcm.c linux-libre-3.18.118-gnu/sound/soc/soc-pcm.c
--- linux-libre-3.18.117-gnu/sound/soc/soc-pcm.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/sound/soc/soc-pcm.c	2018-08-09 06:20:36.000000000 -0400
@@ -1611,8 +1611,10 @@ int dpcm_be_dai_shutdown(struct snd_soc_
 			continue;
 
 		if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
-		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN))
-			continue;
+		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) {
+			soc_pcm_hw_free(be_substream);
+			be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE;
+		}
 
 		dev_dbg(be->dev, "ASoC: close BE %s\n",
 			dpcm->fe->dai_link->name);
diff -druNp --no-dereference linux-libre-3.18.117-gnu/sound/usb/pcm.c linux-libre-3.18.118-gnu/sound/usb/pcm.c
--- linux-libre-3.18.117-gnu/sound/usb/pcm.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/sound/usb/pcm.c	2018-08-09 06:20:36.000000000 -0400
@@ -1263,7 +1263,7 @@ static void retire_capture_urb(struct sn
 		if (bytes % (runtime->sample_bits >> 3) != 0) {
 			int oldbytes = bytes;
 			bytes = frames * stride;
-			dev_warn(&subs->dev->dev,
+			dev_warn_ratelimited(&subs->dev->dev,
 				 "Corrected urb data len. %d->%d\n",
 							oldbytes, bytes);
 		}
diff -druNp --no-dereference linux-libre-3.18.117-gnu/tools/usb/usbip/src/usbip_detach.c linux-libre-3.18.118-gnu/tools/usb/usbip/src/usbip_detach.c
--- linux-libre-3.18.117-gnu/tools/usb/usbip/src/usbip_detach.c	2018-07-28 01:43:19.000000000 -0400
+++ linux-libre-3.18.118-gnu/tools/usb/usbip/src/usbip_detach.c	2018-08-09 06:20:36.000000000 -0400
@@ -43,7 +43,7 @@ void usbip_detach_usage(void)
 
 static int detach_port(char *port)
 {
-	int ret;
+	int ret = 0;
 	uint8_t portnum;
 	char path[PATH_MAX+1];
 
@@ -71,9 +71,12 @@ static int detach_port(char *port)
 	}
 
 	ret = usbip_vhci_detach_device(portnum);
-	if (ret < 0)
-		return -1;
+	if (ret < 0) {
+		ret = -1;
+		goto call_driver_close;
+	}
 
+call_driver_close:
 	usbip_vhci_driver_close();
 
 	return ret;
