Files
linux/drivers
Arnd Bergmann c19bb06726 drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized
commit b74c0a9969 upstream.

gcc-4.9 notices that the validate_init() function returns unintialized
data when called with a zero 'nr_buffers' argument, when called with the
-Wmaybe-uninitialized flag:

drivers/gpu/drm/nouveau/nouveau_gem.c: In function ‘validate_init.isra.6’:
drivers/gpu/drm/nouveau/nouveau_gem.c:457:5: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

However, the only caller of this function always passes a nonzero
argument, and gcc-6 is clever enough to take this into account and
not warn about it any more.

Adding an explicit initialization to -EINVAL here is correct even if
the caller changed, and it avoids the warning on gcc-4.9 as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-By: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25 11:03:48 +01:00
..
2017-12-16 10:33:55 +01:00
2018-02-25 11:03:46 +01:00
2018-02-25 11:03:42 +01:00
2016-09-24 10:07:35 +02:00
2018-02-25 11:03:44 +01:00
2018-01-02 20:33:20 +01:00
2018-02-25 11:03:47 +01:00
2018-02-25 11:03:40 +01:00
2018-02-25 11:03:41 +01:00