Message ID | 20220216030759.1839582-1-chi.minghao@zte.com.cn (mailing list archive) |
---|---|
State | Queued |
Headers | show |
Series | soc/qcom: use struct_size over open coded arithmetic | expand |
diff --git a/drivers/soc/qcom/apr.c b/drivers/soc/qcom/apr.c index 82ca12c9328a..0813dbc5e462 100644 --- a/drivers/soc/qcom/apr.c +++ b/drivers/soc/qcom/apr.c @@ -171,7 +171,7 @@ static int apr_callback(struct rpmsg_device *rpdev, void *buf, return -EINVAL; } - abuf = kzalloc(sizeof(*abuf) + len, GFP_ATOMIC); + abuf = kzalloc((struct_size(abuf, buf, len), GFP_ATOMIC); if (!abuf) return -ENOMEM;