From ab95e090ae9e244add7342e7072be8f34f4e5ccc Mon Sep 17 00:00:00 2001 From: Tony Truong Date: Fri, 25 Feb 2022 01:21:16 -0800 Subject: [PATCH] net: qrtr: fix type for size in smd The return value for of_property_count_u32_elems can be negative in the case of an error or the property is not found. It is incorrect to use size_t, unsigned type, as this can cause an overflow. Switch size from type size_t to int. Change-Id: Ica0425abd034b82994ab32087f04d602ce3dd9e9 Signed-off-by: Tony Truong --- net/qrtr/smd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/qrtr/smd.c b/net/qrtr/smd.c index 228b4407a7b1..cc7bd0d61abb 100644 --- a/net/qrtr/smd.c +++ b/net/qrtr/smd.c @@ -68,8 +68,8 @@ static int qcom_smd_qrtr_probe(struct rpmsg_device *rpdev) { struct qrtr_array svc_arr = {NULL, 0}; struct qrtr_smd_dev *qdev; - size_t size; u32 net_id; + int size; bool rt; int rc;