From: Greg Kroah-Hartman Date: Thu, 23 Jul 2020 17:29:25 +0000 (+0200) Subject: Revert "mei: Avoid the use of one-element arrays" X-Git-Tag: v5.10.7~1954^2~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e24ca92599cb73ea6d2f768632f4e30b6f9983cf;p=platform%2Fkernel%2Flinux-rpi.git Revert "mei: Avoid the use of one-element arrays" This reverts commit 3c3b7ddef7879abb2c42422e898145826c79e5f0, as it turns out Tomas made a better series of patches for this same issue. Cc: Gustavo A. R. Silva Cc: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index f020d55..a44094c 100644 --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c @@ -408,14 +408,14 @@ static int mei_hbm_add_cl_resp(struct mei_device *dev, u8 addr, u8 status) { struct mei_msg_hdr mei_hdr; struct hbm_add_client_response resp; - const size_t len = sizeof(resp); + const size_t len = sizeof(struct hbm_add_client_response); int ret; dev_dbg(dev->dev, "adding client response\n"); mei_hbm_hdr(&mei_hdr, len); - memset(&resp, 0, len); + memset(&resp, 0, sizeof(struct hbm_add_client_response)); resp.hbm_cmd = MEI_HBM_ADD_CLIENT_RES_CMD; resp.me_addr = addr; resp.status = status; diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h index 8c0297f..b1a8d5e 100644 --- a/drivers/misc/mei/hw.h +++ b/drivers/misc/mei/hw.h @@ -346,13 +346,13 @@ struct hbm_add_client_request { * @hbm_cmd: bus message command header * @me_addr: address of the client in ME * @status: if HBMS_SUCCESS then the client can now accept connections. - * @reserved: reserved for alignment. + * @reserved: reserved */ struct hbm_add_client_response { u8 hbm_cmd; u8 me_addr; u8 status; - u8 reserved; + u8 reserved[1]; } __packed; /** @@ -461,7 +461,7 @@ struct hbm_notification { u8 hbm_cmd; u8 me_addr; u8 host_addr; - u8 reserved; + u8 reserved[1]; } __packed; /**