Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1490455 > unrolled thread
| Started by | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| First post | 2016-09-23 23:10 +0200 |
| Last post | 2016-09-25 11:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] drm/nouveau/secboot/gm20b: Fix return value in case of error Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-09-23 23:10 +0200
Re: [Nouveau] [PATCH] drm/nouveau/secboot/gm20b: Fix return value in case of error Alexandre Courbot <gnurou@gmail.com> - 2016-09-25 11:40 +0200
| From | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| Date | 2016-09-23 23:10 +0200 |
| Subject | [PATCH] drm/nouveau/secboot/gm20b: Fix return value in case of error |
| Message-ID | <skFTk-vl-9@gated-at.bofh.it> |
If 'ioremap()' returns 0, 'gm20b_tegra_read_wpr()' will return 0 as well,
which means success.
Return -ENOMEM instead
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Not sure that -ENOMEM is the best value.
I've taken it because it is often used in such a case.
---
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c
index d5395ebfe8d3..d88db933b3fd 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c
@@ -142,7 +142,7 @@ gm20b_tegra_read_wpr(struct gm200_secboot *gsb)
mc = ioremap(TEGRA_MC_BASE, 0xd00);
if (!mc) {
nvkm_error(&sb->subdev, "Cannot map Tegra MC registers\n");
- return PTR_ERR(mc);
+ return -ENOMEM;
}
gsb->wpr_addr = ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_0) |
((u64)ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_HI_0) << 32);
--
2.7.4
[toc] | [next] | [standalone]
| From | Alexandre Courbot <gnurou@gmail.com> |
|---|---|
| Date | 2016-09-25 11:40 +0200 |
| Subject | Re: [Nouveau] [PATCH] drm/nouveau/secboot/gm20b: Fix return value in case of error |
| Message-ID | <sle4F-4Pg-1@gated-at.bofh.it> |
| In reply to | #1490455 |
On Sat, Sep 24, 2016 at 6:06 AM, Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
> If 'ioremap()' returns 0, 'gm20b_tegra_read_wpr()' will return 0 as well,
> which means success.
> Return -ENOMEM instead
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Not sure that -ENOMEM is the best value.
> I've taken it because it is often used in such a case.
> ---
> drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c
> index d5395ebfe8d3..d88db933b3fd 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c
> @@ -142,7 +142,7 @@ gm20b_tegra_read_wpr(struct gm200_secboot *gsb)
> mc = ioremap(TEGRA_MC_BASE, 0xd00);
> if (!mc) {
> nvkm_error(&sb->subdev, "Cannot map Tegra MC registers\n");
> - return PTR_ERR(mc);
> + return -ENOMEM;
> }
> gsb->wpr_addr = ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_0) |
> ((u64)ioread32_native(mc + MC_SECURITY_CARVEOUT2_BOM_HI_0) << 32);
> --
> 2.7.4
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web