scsi: ufs: ufshcd: Remove VLA usage
authorKees Cook <keescook@chromium.org>
Wed, 2 May 2018 23:58:09 +0000 (16:58 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 18 May 2018 14:36:09 +0000 (10:36 -0400)
commitbbe21d7a979245902113e171fdb36b57812b3c3b
tree065870886eef6ec945d0aa5f7e804c2017102969
parent66b7eaca548d716b86ae2417ec103a7f2f6c214c
scsi: ufs: ufshcd: Remove VLA usage

On the quest to remove all VLAs from the kernel[1] this moves buffers
off the stack. In the second instance, this collapses two separately
allocated buffers into a single buffer, since they are used
consecutively, which saves 256 bytes (QUERY_DESC_MAX_SIZE + 1) of stack
space.

[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c