From: Benjamin Herrenschmidt Date: Fri, 11 Sep 2009 05:36:09 +0000 (+1000) Subject: powerpc/iseries: Fix oops reading from /proc/iSeries/mf/*/cmdline X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1d6ed32226326a6e6cd67cd9ee4294bcbb0c9a15;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git powerpc/iseries: Fix oops reading from /proc/iSeries/mf/*/cmdline That code uses dma_mapping_error() with a NULL device, which is a bad idea :-) The proper fix might be to start using some kind of pseudo device for all these low level mappings with the hypervisor but that will be for another day. Since it directly calls into the low level iommu code, I see no problem in having it directly test against DMA_ERROR_CODE instead of using the accessors with a NULL argument for now. Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index fef4d5150517..0d9343df35bc 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c @@ -872,7 +872,7 @@ static int proc_mf_dump_cmdline(char *page, char **start, off_t off, count = 256 - off; dma_addr = iseries_hv_map(page, off + count, DMA_FROM_DEVICE); - if (dma_mapping_error(NULL, dma_addr)) + if (dma_addr == DMA_ERROR_CODE) return -ENOMEM; memset(page, 0, off + count); memset(&vsp_cmd, 0, sizeof(vsp_cmd));