Skip to content

Commit 872e192

Browse files
Colin Ian Kingmartinkpetersen
authored andcommitted
scsi: qedi: remove declaration of nvm_image from stack
The nvm_image is a large struct qedi_nvm_iscsi_image object of over 24K so don't declare it on the stack just for a sizeof requirement; use sizeof on struct qedi_nvm_iscsi_image instead. Fixes: c77a2fa ("scsi: qedi: Add the CRC size within iSCSI NVM image") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Manish Rangankar <mrangankar@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent d6e2635 commit 872e192

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/scsi/qedi/qedi_main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,10 +1392,8 @@ static void qedi_free_nvm_iscsi_cfg(struct qedi_ctx *qedi)
13921392

13931393
static int qedi_alloc_nvm_iscsi_cfg(struct qedi_ctx *qedi)
13941394
{
1395-
struct qedi_nvm_iscsi_image nvm_image;
1396-
13971395
qedi->iscsi_image = dma_alloc_coherent(&qedi->pdev->dev,
1398-
sizeof(nvm_image),
1396+
sizeof(struct qedi_nvm_iscsi_image),
13991397
&qedi->nvm_buf_dma, GFP_KERNEL);
14001398
if (!qedi->iscsi_image) {
14011399
QEDI_ERR(&qedi->dbg_ctx, "Could not allocate NVM BUF.\n");
@@ -2236,14 +2234,13 @@ static void qedi_boot_release(void *data)
22362234
static int qedi_get_boot_info(struct qedi_ctx *qedi)
22372235
{
22382236
int ret = 1;
2239-
struct qedi_nvm_iscsi_image nvm_image;
22402237

22412238
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO,
22422239
"Get NVM iSCSI CFG image\n");
22432240
ret = qedi_ops->common->nvm_get_image(qedi->cdev,
22442241
QED_NVM_IMAGE_ISCSI_CFG,
22452242
(char *)qedi->iscsi_image,
2246-
sizeof(nvm_image));
2243+
sizeof(struct qedi_nvm_iscsi_image));
22472244
if (ret)
22482245
QEDI_ERR(&qedi->dbg_ctx,
22492246
"Could not get NVM image. ret = %d\n", ret);

0 commit comments

Comments
 (0)