aboutsummaryrefslogtreecommitdiff
path: root/drivers/nfc/s3fwrn5/core.c
AgeCommit message (Collapse)AuthorFilesLines
2022-11-21nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send()Shang XiaoJing1-0/+1
s3fwrn5_nci_send() won't free the skb when it failed for the check before s3fwrn5_write(). As the result, the skb will memleak. Free the skb when the check failed. Fixes: c04c674fadeb ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip") Signed-off-by: Shang XiaoJing <[email protected]> Suggested-by: Pavel Machek <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-10-30nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send()Shang XiaoJing1-2/+6
s3fwrn5_nci_send() will call s3fwrn5_i2c_write() or s3fwrn82_uart_write(), and free the skb if write() failed. However, even if the write() run succeeds, the skb will not be freed in write(). As the result, the skb will memleak. s3fwrn5_nci_send() should also free the skb when write() succeeds. Fixes: c04c674fadeb ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip") Signed-off-by: Shang XiaoJing <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-07-25nfc: s3fwrn5: constify nci_opsKrzysztof Kozlowski1-4/+3
s3fwrn5 driver modifies static struct nci_ops only to set prop_ops. Since prop_ops is build time constant with known size, it can be made const. This allows to removeo the function setting the prop_ops - s3fwrn5_nci_get_prop_ops(). Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-06nfc: s3fwrn5: remove unnecessary labelwengjianfeng1-8/+4
In function s3fwrn5_nci_post_setup, the variable ret is assigned then goto out label, which just return ret, so we use return to replace it. Other goto sentences are similar, we use return sentences to replace goto sentences and delete out label. Signed-off-by: wengjianfeng <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-12-04nfc: s3fwrn5: skip the NFC bootloader modeBongsu Jeon1-2/+21
If there isn't a proper NFC firmware image, Bootloader mode will be skipped. Signed-off-by: Bongsu Jeon <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2020-11-18nfc: s3fwrn5: Remove the max_payloadBongsu Jeon1-2/+1
max_payload is unused. Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Bongsu Jeon <[email protected]> Link: https://lore.kernel.org/r/20201117080824epcms2p36f70e06e2d8bd51d1af278b26ca65725@epcms2p3 Signed-off-by: Jakub Kicinski <[email protected]>
2020-07-20nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frameNavid Emamdoost1-0/+1
The implementation of s3fwrn5_recv_frame() is supposed to consume skb on all execution paths. Release skb before returning -ENODEV. Signed-off-by: Navid Emamdoost <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2019-05-24treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 123Thomas Gleixner1-12/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 or later as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 7 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-12-20nfc: s3fwrn5: constify s3fwrn5_phy_ops structuresJulia Lawall1-1/+1
The s3fwrn5_phy_ops structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <[email protected]> Acked-by: Robert Baldyga <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2015-08-20nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC ChipRobert Baldyga1-0/+219
Add driver for Samsung S3FWRN5 NFC controller. S3FWRN5 is using NCI protocol and I2C communication interface. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>