diff options
author | Roy Pledge <Roy.Pledge@freescale.com> | 2013-04-24 17:59:32 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-24 21:49:06 (GMT) |
commit | d7d2876ed0e3b22bddab41ee6dc4e16d33149361 (patch) | |
tree | f4c8ed174674e920820e623999328a5fa1db25ab /drivers/staging | |
parent | 29b70282125b72de8c691df1efc30c5ba56490b4 (diff) | |
download | linux-fsl-qoriq-d7d2876ed0e3b22bddab41ee6dc4e16d33149361.tar.xz |
Fix USDPAA memory mappings so they can no longer occur at address 0
which confused any SW checking for NULL pointers
Change-Id: Ic0ac5e61f1776ce8d4ddb622e401942ce2750705
Reviewed-on: http://git.am.freescale.net:8181/2062
Reviewed-by: Thorpe Geoff-R01361 <Geoff.Thorpe@freescale.com>
Reviewed-by: Ladouceur Jeffrey-R11498 <Jeffrey.Ladouceur@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/fsl_qbman/fsl_usdpaa.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/staging/fsl_qbman/fsl_usdpaa.c b/drivers/staging/fsl_qbman/fsl_usdpaa.c index ca37da3..1a7081c 100644 --- a/drivers/staging/fsl_qbman/fsl_usdpaa.c +++ b/drivers/staging/fsl_qbman/fsl_usdpaa.c @@ -876,7 +876,7 @@ out: if (!ret) { unsigned long longret; down_write(¤t->mm->mmap_sem); - longret = do_mmap_pgoff(fp, 0, map->frag->len, PROT_READ | + longret = do_mmap_pgoff(fp, PAGE_SIZE, map->frag->len, PROT_READ | (i->flags & USDPAA_DMA_FLAG_RDONLY ? 0 : PROT_WRITE), MAP_SHARED, map->frag->pfn_base); up_write(¤t->mm->mmap_sem); @@ -1017,12 +1017,11 @@ static int portal_mmap(struct file *fp, struct resource *res, void **ptr) unsigned long longret = 0; down_write(¤t->mm->mmap_sem); - do { - longret = do_mmap_pgoff(fp, 0, resource_size(res), - PROT_READ | PROT_WRITE, MAP_SHARED, - res->start >> PAGE_SHIFT); - } while (longret == 0); + longret = do_mmap_pgoff(fp, PAGE_SIZE, resource_size(res), + PROT_READ | PROT_WRITE, MAP_SHARED, + res->start >> PAGE_SHIFT); up_write(¤t->mm->mmap_sem); + if (longret & ~PAGE_MASK) return (int)longret; |