Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1490455
| Path | csiph.com!feeder.erje.net!1.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] drm/nouveau/secboot/gm20b: Fix return value in case of error |
| Date | Fri, 23 Sep 2016 23:10:02 +0200 |
| Message-ID | <skFTk-vl-9@gated-at.bofh.it> (permalink) |
| X-Original-To | bskeggs@redhat.com, airlied@linux.ie |
| X-Me-Helo | localhost.localdomain |
| X-Me-Auth | Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= |
| X-Me-Date | Fri, 23 Sep 2016 23:06:33 +0200 |
| X-Me-IP | 92.140.231.207 |
| X-Mailer | git-send-email 2.7.4 |
| X-Antivirus | avast! (VPS 160923-1, 23/09/2016), Outbound message |
| X-Antivirus-Status | Clean |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 27 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
| X-Original-Date | Fri, 23 Sep 2016 23:06:26 +0200 |
| X-Original-Message-ID | <1474664786-30107-1-git-send-email-christophe.jaillet@wanadoo.fr> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1490455 |
Show key headers only | View raw
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
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[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
csiph-web