Commit e0a2b7e4 authored by Breno Leitao's avatar Breno Leitao Committed by Paolo Abeni
Browse files

net: netconsole: Correct mismatched return types



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: default avatarBreno Leitao <leitao@debian.org>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 1ef33652
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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;