- Dec 28, 2021
-
-
Wei Yongjun authored
'phy->pending_skb' is alloced when device probe, but forgot to free in the error handling path and remove path, this cause memory leak as follows: unreferenced object 0xffff88800bc06800 (size 512): comm "8", pid 11775, jiffies 4295159829 (age 9.032s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000d66c09ce>] __kmalloc_node_track_caller+0x1ed/0x450 [<00000000c93382b3>] kmalloc_reserve+0x37/0xd0 [<000000005fea522c>] __alloc_skb+0x124/0x380 [<0000000019f29f9a>] st21nfca_hci_i2c_probe+0x170/0x8f2 Fix it by freeing 'pending_skb' in error and remove. Fixes: 68957303 ("NFC: ST21NFCA: Add driver for STMicroelectronics ST21NFCA NFC Chip") Reported-by:
Hulk Robot <hulkci@huawei.com> Signed-off-by:
Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Nov 26, 2021
-
-
Thadeu Lima de Souza Cascardo authored
Device permissions is S_IALLUGO, with many unnecessary bits. Remove them and also remove read and write permissions from group and others. Before the change: crwsrwsrwt 1 0 0 10, 125 Nov 25 13:59 /dev/virtual_nci After the change: crw------- 1 0 0 10, 125 Nov 25 14:05 /dev/virtual_nci Signed-off-by:
Thadeu Lima de Souza Cascardo <cascardo@canonical.com> Reviewed-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by:
Bongsu Jeon <bongsu.jeon@samsung.com> Link: https://lore.kernel.org/r/20211125141457.716921-1-cascardo@canonical.com Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
- Nov 07, 2021
-
-
Chengfeng Ye authored
skb is already freed by dev_kfree_skb in pn533_fill_fragment_skbs, but follow error handler branch when pn533_fill_fragment_skbs() fails, skb is freed again, results in double free issue. Fix this by not free skb in error path of pn533_fill_fragment_skbs. Fixes: 963a82e0 ("NFC: pn533: Split large Tx frames in chunks") Fixes: 93ad4202 ("NFC: pn533: Target mode Tx fragmentation support") Signed-off-by:
Chengfeng Ye <cyeaa@connect.ust.hk> Reviewed-by:
Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
It is not an error to receive an URB with -ENOENT because it can come from regular user operations, e.g. pressing CTRL+C when running nfctool from neard. Make it a debugging message, not an error. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Oct 26, 2021
-
-
Krzysztof Kozlowski authored
During probing, the driver tries to get a list (mask) of supported command types in port100_get_command_type_mask() function. The value is u64 and 0 is treated as invalid mask (no commands supported). The function however returns also -ERRNO as u64 which will be interpret as valid command mask. Return 0 on every error case of port100_get_command_type_mask(), so the probing will stop. Cc: <stable@vger.kernel.org> Fixes: 0347a6ab ("NFC: port100: Commands mechanism implementation") Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Oct 20, 2021
-
-
Uwe Kleine-König authored
If something goes wrong in the remove callback, returning an error code just results in an error message. The device still disappears. So don't skip disabling the regulator in st95hf_remove() if resetting the controller via spi fails. Also don't return an error code which just results in two error messages. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Oct 12, 2021
-
-
Krzysztof Kozlowski authored
ftrace is a preferred and standard way to debug entering and exiting functions so drop useless debug prints. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
Krzysztof Kozlowski authored
ftrace is a preferred and standard way to debug entering and exiting functions so drop useless debug prints. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Acked-by:
Mark Greer <mgreer@animalcreek.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
Krzysztof Kozlowski authored
ftrace is a preferred and standard way to debug entering and exiting functions so drop useless debug prints. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
Krzysztof Kozlowski authored
ftrace is a preferred and standard way to debug entering and exiting functions so drop useless debug prints. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
Krzysztof Kozlowski authored
Simplify the code dereferencing several pointers to reach the struct device. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
- Oct 07, 2021
-
-
Rikard Falkeborn authored
Neither the driver or the core modifies the pn533_phy_ops struct, so make them const to allow the compiler to put the static structs in read-only memory. Signed-off-by:
Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Rikard Falkeborn authored
The only usage of pn532_serdev_ops is to pass its address to serdev_device_set_client_ops(), which takes a pointer to const serdev_device_ops as argument. Make it const to allow the compiler to put it in read-only memory. Signed-off-by:
Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Sep 23, 2021
-
-
Mark Brown authored
Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding the part name used in the compatible to the list of SPI IDs. Fixes: 96c8395e ("spi: Revert modalias changes") Signed-off-by:
Mark Brown <broonie@kernel.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Sep 13, 2021
-
-
Krzysztof Kozlowski authored
nci_skb_alloc() already prints an error message on memory allocation failure. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
nfc_mei_phy_alloc() already prints an error message on memory allocation failure. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
nfc_mei_phy_alloc() already prints an error message on memory allocation failure. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
ftrace is a preferred and standard way to debug entering and exiting functions so drop useless debug prints. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Print error message with reference to a device. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
ftrace is a preferred and standard way to debug entering and exiting functions so drop useless debug prints. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
ftrace is a preferred and standard way to debug entering and exiting functions so drop useless debug prints. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Aug 26, 2021
-
-
Krzysztof Kozlowski authored
Do not include unnecessary headers. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Do not include unnecessary headers. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Do not include unnecessary headers. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Do not include unnecessary headers. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Do not include unnecessary headers. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Do not include unnecessary headers. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Aug 18, 2021
-
-
Bongsu Jeon authored
In previous version, the user level virtual device application that used this driver should have the polling scheme to read a NCI frame. To remove this polling scheme, use Wait Queue. Signed-off-by:
Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Jul 30, 2021
-
-
Krzysztof Kozlowski authored
Few pointers to struct nfc_target and struct nfc_se can be made const. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
Krzysztof Kozlowski authored
The device_node in nfcmrvl_spi_parse_dt() cannot be const as it is passed to OF functions which modify it. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
- Jul 29, 2021
-
-
Krzysztof Kozlowski authored
File-scope struct nfcmrvl_if_ops is not modified so can be made const. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. This allows also making file-scope nci_core_get_config_otp_ram_version array const. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Loop iterators are simple integers, no point to optimize the size and use u8. It only raises the question whether the variable is used in some other context. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Size of firmware is a type of size_t, so print it directly instead of casting to int. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
nfcsim_abort_cmd() does not modify struct nfcsim, so local variable can be a pointer to const. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
virtual_ncidev_ioctl() does not modify struct nfc_dev, so local variable can be a pointer to const. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Krzysztof Kozlowski authored
Several functions do not modify pointed data so arguments and local variables can be const for correctness and safety. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-