Maarten Maathuis
2009-Dec-21 15:51 UTC
[Nouveau] [PATCH] nouveau: when nouveau_bo_map fails you except it to not be mapped
---
nouveau/nouveau_bo.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/nouveau/nouveau_bo.c b/nouveau/nouveau_bo.c
index 10cc8a6..9d584a3 100644
--- a/nouveau/nouveau_bo.c
+++ b/nouveau/nouveau_bo.c
@@ -444,8 +444,10 @@ nouveau_bo_map_range(struct nouveau_bo *bo, uint32_t delta,
uint32_t size,
if (!(flags & NOUVEAU_BO_NOSYNC)) {
ret = nouveau_bo_wait(bo, (flags & NOUVEAU_BO_WR),
(flags & NOUVEAU_BO_NOWAIT), 0);
- if (ret)
+ if (ret) {
+ nouveau_bo_unmap(bo);
return ret;
+ }
}
bo->map = (char *)nvbo->map + delta;
--
1.6.5.4
Maarten Maathuis
2009-Dec-23 15:31 UTC
[Nouveau] [PATCH] nouveau: when nouveau_bo_map fails you except it to not be mapped
Can this go in? On Mon, Dec 21, 2009 at 4:51 PM, Maarten Maathuis <madman2003 at gmail.com> wrote:> --- > ?nouveau/nouveau_bo.c | ? ?4 +++- > ?1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/nouveau/nouveau_bo.c b/nouveau/nouveau_bo.c > index 10cc8a6..9d584a3 100644 > --- a/nouveau/nouveau_bo.c > +++ b/nouveau/nouveau_bo.c > @@ -444,8 +444,10 @@ nouveau_bo_map_range(struct nouveau_bo *bo, uint32_t delta, uint32_t size, > ? ? ? ? ? ? ? ?if (!(flags & NOUVEAU_BO_NOSYNC)) { > ? ? ? ? ? ? ? ? ? ? ? ?ret = nouveau_bo_wait(bo, (flags & NOUVEAU_BO_WR), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(flags & NOUVEAU_BO_NOWAIT), 0); > - ? ? ? ? ? ? ? ? ? ? ? if (ret) > + ? ? ? ? ? ? ? ? ? ? ? if (ret) { > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? nouveau_bo_unmap(bo); > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?return ret; > + ? ? ? ? ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? ?} > > ? ? ? ? ? ? ? ?bo->map = (char *)nvbo->map + delta; > -- > 1.6.5.4 > >
Maarten Maathuis
2009-Dec-23 17:31 UTC
[Nouveau] [PATCH] nouveau: when nouveau_bo_map fails you except it to not be mapped
That should be s/except/expect On Wed, Dec 23, 2009 at 4:31 PM, Maarten Maathuis <madman2003 at gmail.com> wrote:> Can this go in? > > On Mon, Dec 21, 2009 at 4:51 PM, Maarten Maathuis <madman2003 at gmail.com> wrote: >> --- >> ?nouveau/nouveau_bo.c | ? ?4 +++- >> ?1 files changed, 3 insertions(+), 1 deletions(-) >> >> diff --git a/nouveau/nouveau_bo.c b/nouveau/nouveau_bo.c >> index 10cc8a6..9d584a3 100644 >> --- a/nouveau/nouveau_bo.c >> +++ b/nouveau/nouveau_bo.c >> @@ -444,8 +444,10 @@ nouveau_bo_map_range(struct nouveau_bo *bo, uint32_t delta, uint32_t size, >> ? ? ? ? ? ? ? ?if (!(flags & NOUVEAU_BO_NOSYNC)) { >> ? ? ? ? ? ? ? ? ? ? ? ?ret = nouveau_bo_wait(bo, (flags & NOUVEAU_BO_WR), >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(flags & NOUVEAU_BO_NOWAIT), 0); >> - ? ? ? ? ? ? ? ? ? ? ? if (ret) >> + ? ? ? ? ? ? ? ? ? ? ? if (ret) { >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? nouveau_bo_unmap(bo); >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?return ret; >> + ? ? ? ? ? ? ? ? ? ? ? } >> ? ? ? ? ? ? ? ?} >> >> ? ? ? ? ? ? ? ?bo->map = (char *)nvbo->map + delta; >> -- >> 1.6.5.4 >> >> >