android_kernel_oneplus_msm8998/drivers/of
Rob Herring 60872f9e19 of: fix of_device_get_modalias returned length when truncating buffers
[ Upstream commit bcf54d5385abaea9c8026aae6f4eeb348671a52d ]

If the length of the modalias is greater than the buffer size, then the
modalias is truncated. However the untruncated length is returned which
will cause an error. Fix this to return the truncated length. If an error
in the case was desired, then then we should just return -ENOMEM.

The reality is no device will ever have 4KB of compatible strings to hit
this case.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22 09:23:21 +01:00
..
unittest-data of/unittest: replace 'selftest' with 'unittest' 2015-03-25 00:53:29 -05:00
address.c of: fix sparse warning in of_pci_range_parser_one 2017-05-25 14:30:10 +02:00
base.c of: fix reference counting in of_graph_get_endpoint_by_regs 2016-09-07 08:32:41 +02:00
device.c of: fix of_device_get_modalias returned length when truncating buffers 2018-03-22 09:23:21 +01:00
dynamic.c of: fix memory leak related to safe_name() 2016-08-20 18:09:25 +02:00
fdt.c of: Add check to of_scan_flat_dt() before accessing initial_boot_params 2017-06-29 12:48:52 +02:00
fdt_address.c of/fdt: add FDT address translation support 2014-05-20 15:19:25 -05:00
irq.c of: irq: fix of_irq_get[_byname]() kernel-doc 2016-07-27 09:47:29 -07:00
Kconfig of: add config option to enable building of all dtbs 2015-10-27 16:12:13 -05:00
Makefile of: clean-up unnecessary libfdt include paths 2015-06-04 20:16:47 -05:00
of_mdio.c of_mdio: fix MDIO phy device refcounting 2015-09-24 23:04:52 -07:00
of_mtd.c of_mtd: Add helpers to get ECC strength and ECC step size 2014-03-10 22:42:28 -07:00
of_net.c of_net: factor out repetitive code from of_get_mac_address() 2015-03-29 08:56:17 +01:00
of_pci.c More power management and ACPI updates for v4.4-rc1 2015-11-12 11:50:33 -08:00
of_pci_irq.c of_pci_irq: Silence bogus "of_irq_parse_pci() failed ..." messages. 2015-09-17 14:46:11 -05:00
of_private.h of: fix memory leak related to safe_name() 2016-08-20 18:09:25 +02:00
of_reserved_mem.c of: silence warnings due to max() usage 2016-11-15 07:46:39 +01:00
overlay.c of/overlay: add missing of_node_put 2015-10-22 09:35:51 -05:00
pdt.c of: Eliminate of_allnodes list 2014-11-04 13:29:38 +00:00
platform.c of/platform: add missing of_node_put 2015-10-22 09:26:44 -05:00
resolver.c of/resolver: Switch to new local fixups format. 2014-11-24 22:24:50 +00:00
unittest.c of/unittest: add missing of_node_put 2015-10-22 09:26:28 -05:00