]> git.baikalelectronics.ru Git - kernel.git/commit
mptfusion: don't allow negative bytes in kbuf_alloc_2_sgl()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 10 Nov 2015 22:15:24 +0000 (01:15 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 12 Nov 2015 01:58:06 +0000 (20:58 -0500)
commitb5c4fe53fdb8a82f6334a2ec4ece97c806167217
tree06afd0fdae385397f4875d820ad66ae7aec8f93b
parent8204f9e082fb607e30709e358bcd82e54f8873a4
mptfusion: don't allow negative bytes in kbuf_alloc_2_sgl()

There is a static checker warning here because "bytes" is controlled by
the user and we cap the upper bound with min() but allow negatives.
Negative bytes will result in some nasty warning messages but are not
super harmful.  Anyway, no one needs negative bytes so let's just check
for it and return NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/message/fusion/mptctl.c