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 Gerrit - the friendly Code Review server
parent 1da9ab5d38
commit ab95e090ae

View File

@ -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;