Skip to content

Commit

Permalink
mga_dma: return 'err' not just zero from mga_do_cleanup_dma()
Browse files Browse the repository at this point in the history
While reading some code I stumbled across the use of 'err' in
drivers/char/drm/mga_dma.c::mga_do_cleanup_dma() and I think there's a small
problem.

The variable is only used inside #if __OS_HAS_AGP which is fine, but all that
ever happens is an assignment to the variable - it is never actually used for
anything.  The variable is nicely initialized to zero which is also what the
return statement at the end of function returns (always at the moment).

It looks to me like that function should be returning 'err' instead of always
just returning 0.  Here's a patch to do that.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Jesper Juhl authored and Dave Airlie committed Feb 7, 2008
1 parent e3236a1 commit a96ca10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/drm/mga_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ static int mga_do_cleanup_dma(struct drm_device *dev, int full_cleanup)
}
}

return 0;
return err;
}

int mga_dma_init(struct drm_device *dev, void *data,
Expand Down

0 comments on commit a96ca10

Please sign in to comment.