]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: netconsole: Correct mismatched return types
authorBreno Leitao <leitao@debian.org>
Thu, 8 Aug 2024 12:25:08 +0000 (05:25 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 13 Aug 2024 08:58:58 +0000 (10:58 +0200)
netconsole incorrectly mixes int and ssize_t types by using int for
return variables in functions that should return ssize_t.

This is fixed by updating the return variables to the appropriate
ssize_t type, ensuring consistency across the function definitions.

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/netconsole.c

index ffedf7648bedf3833439fb7565d69200d5b32d8d..b4d2ef109e31cea68d00a8666ffa6d06de80bd25 100644 (file)
@@ -336,7 +336,7 @@ static ssize_t enabled_store(struct config_item *item,
        struct netconsole_target *nt = to_target(item);
        unsigned long flags;
        bool enabled;
-       int err;
+       ssize_t err;
 
        mutex_lock(&dynamic_netconsole_mutex);
        err = kstrtobool(buf, &enabled);
@@ -394,7 +394,7 @@ static ssize_t release_store(struct config_item *item, const char *buf,
 {
        struct netconsole_target *nt = to_target(item);
        bool release;
-       int err;
+       ssize_t err;
 
        mutex_lock(&dynamic_netconsole_mutex);
        if (nt->enabled) {
@@ -422,7 +422,7 @@ static ssize_t extended_store(struct config_item *item, const char *buf,
 {
        struct netconsole_target *nt = to_target(item);
        bool extended;
-       int err;
+       ssize_t err;
 
        mutex_lock(&dynamic_netconsole_mutex);
        if (nt->enabled) {
@@ -469,7 +469,7 @@ static ssize_t local_port_store(struct config_item *item, const char *buf,
                size_t count)
 {
        struct netconsole_target *nt = to_target(item);
-       int rv = -EINVAL;
+       ssize_t rv = -EINVAL;
 
        mutex_lock(&dynamic_netconsole_mutex);
        if (nt->enabled) {
@@ -492,7 +492,7 @@ static ssize_t remote_port_store(struct config_item *item,
                const char *buf, size_t count)
 {
        struct netconsole_target *nt = to_target(item);
-       int rv = -EINVAL;
+       ssize_t rv = -EINVAL;
 
        mutex_lock(&dynamic_netconsole_mutex);
        if (nt->enabled) {
@@ -685,7 +685,7 @@ static ssize_t userdatum_value_store(struct config_item *item, const char *buf,
        struct userdatum *udm = to_userdatum(item);
        struct netconsole_target *nt;
        struct userdata *ud;
-       int ret;
+       ssize_t ret;
 
        if (count > MAX_USERDATA_VALUE_LENGTH)
                return -EMSGSIZE;