Jimmy Rentz
2011-Apr-17 20:14 UTC
[Nouveau] [PATCH] drm/nouveau: Fix a complier warning in the card init error path
Fix an unitialized variable complier warning in nouveau_card_init.
Signed-off-by: Jimmy Rentz <jb17bsome at gmail.com>
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c
b/drivers/gpu/drm/nouveau/nouveau_state.c
index 3404950..66e8037 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -679,7 +679,7 @@ out_fifo:
engine->fifo.takedown(dev);
out_engine:
if (!nouveau_noaccel) {
- for (e = e - 1; e >= 0; e--) {
+ for (e = NVOBJ_ENGINE_NR - 1; e >= 0; e--) {
if (!dev_priv->eng[e])
continue;
dev_priv->eng[e]->fini(dev, e);
Marcin Slusarz
2011-Apr-17 21:18 UTC
[Nouveau] [PATCH] drm/nouveau: Fix a complier warning in the card init error path
On Sun, Apr 17, 2011 at 04:14:53PM -0400, Jimmy Rentz wrote:> Fix an unitialized variable complier warning in nouveau_card_init. > > Signed-off-by: Jimmy Rentz <jb17bsome at gmail.com> > > diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c > index 3404950..66e8037 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_state.c > +++ b/drivers/gpu/drm/nouveau/nouveau_state.c > @@ -679,7 +679,7 @@ out_fifo: > engine->fifo.takedown(dev); > out_engine: > if (!nouveau_noaccel) { > - for (e = e - 1; e >= 0; e--) { > + for (e = NVOBJ_ENGINE_NR - 1; e >= 0; e--) { > if (!dev_priv->eng[e]) > continue; > dev_priv->eng[e]->fini(dev, e);This code is supposed to handle the situation when one of engine initialization routines failed and this change will break it... Marcin