mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
scsi: ufs: rpmb: Use unaligned accessors for RPMB frames
RPMB frame buffers are passed as u8 pointers and do not have an alignment guarantee. Use unaligned accessors for the req_resp field. Signed-off-by: Li Qiang <liqiang01@kylinos.cn> Reviewed-by: Peter Wang <peter.wang@mediatek.com> Link: https://patch.msgid.link/20260717153914.26321-6-liqiang01@kylinos.cn Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
a947b8edbd
commit
2f434f815e
|
|
@ -73,7 +73,7 @@ static int ufs_rpmb_route_frames(struct device *dev, u8 *req, unsigned int req_l
|
|||
if (req_len < sizeof(*frm_out))
|
||||
return -EINVAL;
|
||||
|
||||
req_type = be16_to_cpu(frm_out->req_resp);
|
||||
req_type = get_unaligned_be16(&frm_out->req_resp);
|
||||
|
||||
switch (req_type) {
|
||||
case RPMB_PROGRAM_KEY:
|
||||
|
|
@ -111,7 +111,7 @@ static int ufs_rpmb_route_frames(struct device *dev, u8 *req, unsigned int req_l
|
|||
struct rpmb_frame *frm_resp = (struct rpmb_frame *)resp;
|
||||
|
||||
memset(frm_resp, 0, sizeof(*frm_resp));
|
||||
frm_resp->req_resp = cpu_to_be16(RPMB_RESULT_READ);
|
||||
put_unaligned_be16(RPMB_RESULT_READ, &frm_resp->req_resp);
|
||||
ret = ufs_sec_submit(hba, protocol_id, resp, resp_len, true);
|
||||
if (ret) {
|
||||
dev_err(dev, "Result read request failed with ret=%d\n", ret);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user