drm/nouveau: do not allow negative sizes for now
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>
Sun, 7 Jul 2013 08:40:19 +0000 (10:40 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 10 Jul 2013 00:48:07 +0000 (10:48 +1000)
commit0108bc808107b97e101b15af9705729626be6447
tree1daa36e4937fdeca38f7efdcecb83b1e56046258
parent9b234db37825860b833ba110673301e2009f0546
drm/nouveau: do not allow negative sizes for now

The API allows up to 64-bits allocations, but size is handled as int
inside nouveau almost everywhere. Until this is fixed it's better to
prevent negative sizes.

The 256 kB before INT_MAX is paranoia, because of the large page
aligning below that could flip it above INT_MAX.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bo.c