Skip to content

Commit d3ea693

Browse files
committed
Merge tag 'm68knommu-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
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
2 parents 2dca74a + 9e2b6ed commit d3ea693

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

arch/m68k/coldfire/pci.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ static int __init mcf_pci_init(void)
216216

217217
/* Keep a virtual mapping to IO/config space active */
218218
iospace = (unsigned long) ioremap(PCI_IO_PA, PCI_IO_SIZE);
219-
if (iospace == 0)
219+
if (iospace == 0) {
220+
pci_free_host_bridge(bridge);
220221
return -ENODEV;
222+
}
221223
pr_info("Coldfire: PCI IO/config window mapped to 0x%x\n",
222224
(u32) iospace);
223225

arch/m68k/configs/stmark2_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ CONFIG_MTD_CFI_STAA=y
4848
CONFIG_MTD_ROM=y
4949
CONFIG_MTD_COMPLEX_MAPPINGS=y
5050
CONFIG_MTD_PLATRAM=y
51-
CONFIG_MTD_M25P80=y
5251
CONFIG_MTD_SPI_NOR=y
5352
# CONFIG_INPUT_KEYBOARD is not set
5453
# CONFIG_INPUT_MOUSE is not set

arch/m68k/include/asm/uaccess_no.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static inline int _access_ok(unsigned long addr, unsigned long size)
4242
__put_user_asm(__pu_err, __pu_val, ptr, l); \
4343
break; \
4444
case 8: \
45-
memcpy(ptr, &__pu_val, sizeof (*(ptr))); \
45+
memcpy((void __force *)ptr, &__pu_val, sizeof(*(ptr))); \
4646
break; \
4747
default: \
4848
__pu_err = __put_user_bad(); \
@@ -60,7 +60,7 @@ extern int __put_user_bad(void);
6060
* aliasing issues.
6161
*/
6262

63-
#define __ptr(x) ((unsigned long *)(x))
63+
#define __ptr(x) ((unsigned long __user *)(x))
6464

6565
#define __put_user_asm(err,x,ptr,bwl) \
6666
__asm__ ("move" #bwl " %0,%1" \
@@ -85,7 +85,7 @@ extern int __put_user_bad(void);
8585
u64 l; \
8686
__typeof__(*(ptr)) t; \
8787
} __gu_val; \
88-
memcpy(&__gu_val.l, ptr, sizeof(__gu_val.l)); \
88+
memcpy(&__gu_val.l, (const void __force *)ptr, sizeof(__gu_val.l)); \
8989
(x) = __gu_val.t; \
9090
break; \
9191
} \

0 commit comments

Comments
 (0)