Skip to content

Commit e24ca92

Browse files
committed
Revert "mei: Avoid the use of one-element arrays"
This reverts commit 3c3b7dd, as it turns out Tomas made a better series of patches for this same issue. Cc: Gustavo A. R. Silva <gustavoars@kernel.org> Cc: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 20f7151 commit e24ca92

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎drivers/misc/mei/hbm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,14 +408,14 @@ static int mei_hbm_add_cl_resp(struct mei_device *dev, u8 addr, u8 status)
408408
{
409409
struct mei_msg_hdr mei_hdr;
410410
struct hbm_add_client_response resp;
411-
const size_t len = sizeof(resp);
411+
const size_t len = sizeof(struct hbm_add_client_response);
412412
int ret;
413413

414414
dev_dbg(dev->dev, "adding client response\n");
415415

416416
mei_hbm_hdr(&mei_hdr, len);
417417

418-
memset(&resp, 0, len);
418+
memset(&resp, 0, sizeof(struct hbm_add_client_response));
419419
resp.hbm_cmd = MEI_HBM_ADD_CLIENT_RES_CMD;
420420
resp.me_addr = addr;
421421
resp.status = status;

‎drivers/misc/mei/hw.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,13 @@ struct hbm_add_client_request {
346346
* @hbm_cmd: bus message command header
347347
* @me_addr: address of the client in ME
348348
* @status: if HBMS_SUCCESS then the client can now accept connections.
349-
* @reserved: reserved for alignment.
349+
* @reserved: reserved
350350
*/
351351
struct hbm_add_client_response {
352352
u8 hbm_cmd;
353353
u8 me_addr;
354354
u8 status;
355-
u8 reserved;
355+
u8 reserved[1];
356356
} __packed;
357357

358358
/**
@@ -461,7 +461,7 @@ struct hbm_notification {
461461
u8 hbm_cmd;
462462
u8 me_addr;
463463
u8 host_addr;
464-
u8 reserved;
464+
u8 reserved[1];
465465
} __packed;
466466

467467
/**

0 commit comments

Comments
 (0)