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 <quic_truong@quicinc.com>
This commit is contained in:
Tony Truong 2022-02-25 01:21:16 -08:00 • committed by Alexander Winkowski
commit 691b019901
No known key found for this signature in database
GPG key ID: 72762A66704CDE44

View file

@ -64,8 +64,7 @@ static int qcom_smd_qrtr_probe(struct rpmsg_device *rpdev)
struct qrtr_smd_dev *qdev;
u32 net_id;
bool rt;
int rc;
size_t size;
int rc, size;
struct qrtr_array svc_arr = {NULL, 0};
pr_info("%s:Entered\n", __func__);