Merge tag 'm68knommu-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Jun 2020 19:50:54 +0000 (12:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Jun 2020 19:50:54 +0000 (12:50 -0700)
Pull m68knommu updates from Greg Ungerer:

 - casting clean up in the user access macros

 - memory leak on error case fix for PCI probing

 - update of a defconfig

* tag 'm68knommu-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
  m68k,nommu: fix implicit cast from __user in __{get,put}_user_asm()
  m68k,nommu: add missing __user in uaccess' __ptr() macro
  m68k: Drop CONFIG_MTD_M25P80 in stmark2_defconfig
  m68k/PCI: Fix a memory leak in an error handling path

arch/m68k/coldfire/pci.c
arch/m68k/configs/stmark2_defconfig
arch/m68k/include/asm/uaccess_no.h

index 62b0eb6..84eab0f 100644 (file)
@@ -216,8 +216,10 @@ static int __init mcf_pci_init(void)
 
        /* Keep a virtual mapping to IO/config space active */
        iospace = (unsigned long) ioremap(PCI_IO_PA, PCI_IO_SIZE);
-       if (iospace == 0)
+       if (iospace == 0) {
+               pci_free_host_bridge(bridge);
                return -ENODEV;
+       }
        pr_info("Coldfire: PCI IO/config window mapped to 0x%x\n",
                (u32) iospace);
 
index 27fa946..2b746f5 100644 (file)
@@ -48,7 +48,6 @@ CONFIG_MTD_CFI_STAA=y
 CONFIG_MTD_ROM=y
 CONFIG_MTD_COMPLEX_MAPPINGS=y
 CONFIG_MTD_PLATRAM=y
-CONFIG_MTD_M25P80=y
 CONFIG_MTD_SPI_NOR=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
index a24cfe4..dcfb693 100644 (file)
@@ -42,7 +42,7 @@ static inline int _access_ok(unsigned long addr, unsigned long size)
        __put_user_asm(__pu_err, __pu_val, ptr, l);     \
        break;                                          \
     case 8:                                            \
-       memcpy(ptr, &__pu_val, sizeof (*(ptr))); \
+       memcpy((void __force *)ptr, &__pu_val, sizeof(*(ptr))); \
        break;                                          \
     default:                                           \
        __pu_err = __put_user_bad();                    \
@@ -60,7 +60,7 @@ extern int __put_user_bad(void);
  * aliasing issues.
  */
 
-#define __ptr(x) ((unsigned long *)(x))
+#define __ptr(x) ((unsigned long __user *)(x))
 
 #define __put_user_asm(err,x,ptr,bwl)                          \
        __asm__ ("move" #bwl " %0,%1"                           \
@@ -85,7 +85,7 @@ extern int __put_user_bad(void);
            u64 l;                                              \
            __typeof__(*(ptr)) t;                               \
        } __gu_val;                                             \
-       memcpy(&__gu_val.l, ptr, sizeof(__gu_val.l));           \
+       memcpy(&__gu_val.l, (const void __force *)ptr, sizeof(__gu_val.l)); \
        (x) = __gu_val.t;                                       \
        break;                                                  \
     }                                                          \