lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5606DA89.9060505@redhat.com>
Date:	Sat, 26 Sep 2015 20:48:57 +0300
From:	Nikolai Kondrashov <Nikolai.Kondrashov@...hat.com>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Jiri Kosina <jikos@...nel.org>
CC:	Arve Hjønnevåg <arve@...roid.com>,
	Jaikumar Ganesh <jaikumarg@...roid.com>,
	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Sebastian Reichel <sre@...nel.org>,
	James C Boyd <jcboyd.dev@...il.com>,
	Karl Relton <karllinuxtest.relton@...world.com>,
	David Herrmann <dh.herrmann@...il.com>,
	Olivier Gay <ogay@...itech.com>,
	Ross Skaliotis <rskaliotis@...il.com>,
	Jamie Lentin <jm@...tin.co.uk>,
	Benjamin Tissoires <benjamin.tissoires@...il.com>,
	Andreas Fleig <andreasfleig@...il.com>,
	Alexey Khoroshilov <khoroshilov@...ras.ru>,
	Peter Wu <peter@...ensteyn.nl>,
	Goffredo Baroncelli <kreijack@...ind.it>,
	Mathieu Magnaudet <mathieu.magnaudet@...il.com>,
	Brent Adam <brentadamdev@...il.com>,
	Yang Bo <linuxsea@....com>,
	Seth Forshee <seth.forshee@...onical.com>,
	Andrew Duggan <aduggan@...aptics.com>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	Frank Praznik <frank.praznik@...rr.com>,
	Simon Wood <simon@...gewell.org>, Antonio Ospite <ao2@....it>,
	JD Cole <jd@....me>, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: hid-input: allow input_configured callback return
 errors

On 09/26/2015 02:14 AM, Dmitry Torokhov wrote:
> When configuring input device via input_configured callback we may
> encounter errors (for example input_mt_init_slots() may fail). Instead
> of continuing with half-initialized input device let's allow driver
> indicate failures.
>
> diff --git a/drivers/hid/hid-uclogic.c b/drivers/hid/hid-uclogic.c
> index b905d50..85ac435 100644
> --- a/drivers/hid/hid-uclogic.c
> +++ b/drivers/hid/hid-uclogic.c
> @@ -731,7 +731,7 @@ static int uclogic_input_mapping(struct hid_device *hdev, struct hid_input *hi,
>   	return 0;
>   }
>
> -static void uclogic_input_configured(struct hid_device *hdev,
> +static int uclogic_input_configured(struct hid_device *hdev,
>   		struct hid_input *hi)
>   {
>   	char *name;
> @@ -741,7 +741,7 @@ static void uclogic_input_configured(struct hid_device *hdev,
>
>   	/* no report associated (HID_QUIRK_MULTI_INPUT not set) */
>   	if (!hi->report)
> -		return;
> +		return 0;
>
>   	field = hi->report->field[0];
>
> @@ -774,6 +774,8 @@ static void uclogic_input_configured(struct hid_device *hdev,
>   			hi->input->name = name;
>   		}
>   	}
> +
> +	return 0;
>   }
>
>   /**

The hid-uclogic.c change looks perfectly fine to me.

Thank you, Dmitri.

The next step would be to report devm_kzalloc failure instead of ignoring it.

Nick
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ