drm/nouveau/secboot/gm20b: fix the error return code in gm20b_secboot_tegra_read_wpr()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 25 Apr 2017 14:36:42 +0000 (14:36 +0000)
committerBen Skeggs <bskeggs@redhat.com>
Sat, 29 Apr 2017 12:39:23 +0000 (22:39 +1000)
The error return code PTR_ERR(mc) is always 0 since mc is
equal to 0 in this error handling case.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c

index b10ed59a49116a70e27c7d62f0ebdd16c717ca64..30491d132d59c08cf6defd83c0169c1b83b227c7 100644 (file)
@@ -48,7 +48,7 @@ gm20b_secboot_tegra_read_wpr(struct gm200_secboot *gsb, u32 mc_base)
        mc = ioremap(mc_base, 0xd00);
        if (!mc) {
                nvkm_error(&sb->subdev, "Cannot map Tegra MC registers\n");
-               return PTR_ERR(mc);
+               return -ENOMEM;
        }
        sb->wpr_addr = ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_0) |
              ((u64)ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_HI_0) << 32);