From e0a27badde20868cf3a5b4a44305b90af00e4f3f Mon Sep 17 00:00:00 2001 From: Joker2770 <1214220480@qq.com> Date: Mon, 28 Jun 2021 09:33:29 +0800 Subject: [PATCH] perf: assign '-1' to uninitialized variable: ret Signed-off-by: Joker2770 <1214220480@qq.com> --- drivers/char/random/src/random_hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/random/src/random_hw.c b/drivers/char/random/src/random_hw.c index ffaa495a..a290a586 100644 --- a/drivers/char/random/src/random_hw.c +++ b/drivers/char/random/src/random_hw.c @@ -65,7 +65,7 @@ static int RandomHwClose(struct file *filep) static int RandomHwIoctl(struct file *filep, int cmd, unsigned long arg) { - int ret; + int ret = -1; switch (cmd) { default: @@ -77,7 +77,7 @@ static int RandomHwIoctl(struct file *filep, int cmd, unsigned long arg) static ssize_t RandomHwRead(struct file *filep, char *buffer, size_t buflen) { - int ret; + int ret = -1; if (g_randomOp.read != NULL) { ret = g_randomOp.read(buffer, buflen); -- GitLab