Skip to content

Commit 412572b

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: - a quirk to i8042 to ignore timeout bit on Lifebook AH544 - a fixup to Synaptics RMI function 54 that was breaking some Dells - a fix for memory leak in soc_button_array driver * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: synaptics-rmi4 - only read the F54 query registers which are used Input: i8042 - add Fujitsu Lifebook AH544 to notimeout list Input: soc_button_array - fix leaking the ACPI button descriptor buffer
2 parents d5d5c18 + 9768935 commit 412572b

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

drivers/input/misc/soc_button_array.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ static struct soc_button_info *soc_button_get_button_info(struct device *dev)
248248

249249
if (!btns_desc) {
250250
dev_err(dev, "ACPI Button Descriptors not found\n");
251-
return ERR_PTR(-ENODEV);
251+
button_info = ERR_PTR(-ENODEV);
252+
goto out;
252253
}
253254

254255
/* The first package describes the collection */
@@ -264,24 +265,31 @@ static struct soc_button_info *soc_button_get_button_info(struct device *dev)
264265
}
265266
if (collection_uid == -1) {
266267
dev_err(dev, "Invalid Button Collection Descriptor\n");
267-
return ERR_PTR(-ENODEV);
268+
button_info = ERR_PTR(-ENODEV);
269+
goto out;
268270
}
269271

270272
/* There are package.count - 1 buttons + 1 terminating empty entry */
271273
button_info = devm_kcalloc(dev, btns_desc->package.count,
272274
sizeof(*button_info), GFP_KERNEL);
273-
if (!button_info)
274-
return ERR_PTR(-ENOMEM);
275+
if (!button_info) {
276+
button_info = ERR_PTR(-ENOMEM);
277+
goto out;
278+
}
275279

276280
/* Parse the button descriptors */
277281
for (i = 1, btn = 0; i < btns_desc->package.count; i++, btn++) {
278282
if (soc_button_parse_btn_desc(dev,
279283
&btns_desc->package.elements[i],
280284
collection_uid,
281-
&button_info[btn]))
282-
return ERR_PTR(-ENODEV);
285+
&button_info[btn])) {
286+
button_info = ERR_PTR(-ENODEV);
287+
goto out;
288+
}
283289
}
284290

291+
out:
292+
kfree(buf.pointer);
285293
return button_info;
286294
}
287295

drivers/input/rmi4/rmi_f54.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
#define F54_GET_REPORT 1
3232
#define F54_FORCE_CAL 2
3333

34-
/* Fixed sizes of reports */
35-
#define F54_QUERY_LEN 27
36-
3734
/* F54 capabilities */
3835
#define F54_CAP_BASELINE (1 << 2)
3936
#define F54_CAP_IMAGE8 (1 << 3)
@@ -95,7 +92,6 @@ struct rmi_f54_reports {
9592
struct f54_data {
9693
struct rmi_function *fn;
9794

98-
u8 qry[F54_QUERY_LEN];
9995
u8 num_rx_electrodes;
10096
u8 num_tx_electrodes;
10197
u8 capabilities;
@@ -632,22 +628,23 @@ static int rmi_f54_detect(struct rmi_function *fn)
632628
{
633629
int error;
634630
struct f54_data *f54;
631+
u8 buf[6];
635632

636633
f54 = dev_get_drvdata(&fn->dev);
637634

638635
error = rmi_read_block(fn->rmi_dev, fn->fd.query_base_addr,
639-
&f54->qry, sizeof(f54->qry));
636+
buf, sizeof(buf));
640637
if (error) {
641638
dev_err(&fn->dev, "%s: Failed to query F54 properties\n",
642639
__func__);
643640
return error;
644641
}
645642

646-
f54->num_rx_electrodes = f54->qry[0];
647-
f54->num_tx_electrodes = f54->qry[1];
648-
f54->capabilities = f54->qry[2];
649-
f54->clock_rate = f54->qry[3] | (f54->qry[4] << 8);
650-
f54->family = f54->qry[5];
643+
f54->num_rx_electrodes = buf[0];
644+
f54->num_tx_electrodes = buf[1];
645+
f54->capabilities = buf[2];
646+
f54->clock_rate = buf[3] | (buf[4] << 8);
647+
f54->family = buf[5];
651648

652649
rmi_dbg(RMI_DEBUG_FN, &fn->dev, "F54 num_rx_electrodes: %d\n",
653650
f54->num_rx_electrodes);

drivers/input/serio/i8042-x86ia64io.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,13 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
723723
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
724724
},
725725
},
726+
{
727+
/* Fujitsu UH554 laptop */
728+
.matches = {
729+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
730+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
731+
},
732+
},
726733
{ }
727734
};
728735

0 commit comments

Comments
 (0)