Skip to content

Commit

Permalink
Merge tag 'nfc-next-4.6-1' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/sameo/nfc-next

Samuel Ortiz says:

====================
NFC 4.6 pull request

This is a very small one this time, with only 5 patches.
There are a couple of big items that could not be merged/finished
on time.

We have:

- 2 LLCP fixes for a race and a potential OOM.
- 2 cleanups for the pn544 and microread drivers.
- 1 Maintainer addition for the s3fwrn5 driver.
====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Mar 14, 2016
2 parents 0109988 + 079c265 commit f4fa6e6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 59 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -7666,7 +7666,6 @@ F: net/nfc/
F: include/net/nfc/
F: include/uapi/linux/nfc.h
F: drivers/nfc/
F: include/linux/platform_data/microread.h
F: include/linux/platform_data/nfcmrvl.h
F: include/linux/platform_data/nxp-nci.h
F: include/linux/platform_data/pn544.h
Expand Down Expand Up @@ -9509,6 +9508,7 @@ F: drivers/media/i2c/s5k5baf.c

SAMSUNG S3FWRN5 NFC DRIVER
M: Robert Baldyga <[email protected]>
M: Krzysztof Opasiak <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Supported
F: drivers/nfc/s3fwrn5
Expand Down
8 changes: 0 additions & 8 deletions drivers/nfc/microread/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,10 @@ static int microread_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct microread_i2c_phy *phy;
struct microread_nfc_platform_data *pdata =
dev_get_platdata(&client->dev);
int r;

dev_dbg(&client->dev, "client %p\n", client);

if (!pdata) {
nfc_err(&client->dev, "client %p: missing platform data\n",
client);
return -EINVAL;
}

phy = devm_kzalloc(&client->dev, sizeof(struct microread_i2c_phy),
GFP_KERNEL);
if (!phy)
Expand Down
14 changes: 1 addition & 13 deletions drivers/nfc/pn544/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,20 +877,8 @@ static void pn544_hci_i2c_fw_work(struct work_struct *work)
static int pn544_hci_i2c_acpi_request_resources(struct i2c_client *client)
{
struct pn544_i2c_phy *phy = i2c_get_clientdata(client);
const struct acpi_device_id *id;
struct gpio_desc *gpiod_en, *gpiod_fw;
struct device *dev;

if (!client)
return -EINVAL;

dev = &client->dev;

/* Match the struct device against a given list of ACPI IDs */
id = acpi_match_device(dev->driver->acpi_match_table, dev);

if (!id)
return -ENODEV;
struct device *dev = &client->dev;

/* Get EN GPIO from ACPI */
gpiod_en = devm_gpiod_get_index(dev, PN544_GPIO_NAME_EN, 1,
Expand Down
35 changes: 0 additions & 35 deletions include/linux/platform_data/microread.h

This file was deleted.

4 changes: 2 additions & 2 deletions net/nfc/llcp_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
return -ENOBUFS;
}

msg_data = kzalloc(len, GFP_KERNEL);
msg_data = kmalloc(len, GFP_USER | __GFP_NOWARN);
if (msg_data == NULL)
return -ENOMEM;

Expand Down Expand Up @@ -729,7 +729,7 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,
if (local == NULL)
return -ENODEV;

msg_data = kzalloc(len, GFP_KERNEL);
msg_data = kmalloc(len, GFP_USER | __GFP_NOWARN);
if (msg_data == NULL)
return -ENOMEM;

Expand Down
6 changes: 6 additions & 0 deletions net/nfc/llcp_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,11 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr,
memset(llcp_addr, 0, sizeof(*llcp_addr));
*len = sizeof(struct sockaddr_nfc_llcp);

lock_sock(sk);
if (!llcp_sock->dev) {
release_sock(sk);
return -EBADFD;
}
llcp_addr->sa_family = AF_NFC;
llcp_addr->dev_idx = llcp_sock->dev->idx;
llcp_addr->target_idx = llcp_sock->target_idx;
Expand All @@ -518,6 +523,7 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr,
llcp_addr->service_name_len = llcp_sock->service_name_len;
memcpy(llcp_addr->service_name, llcp_sock->service_name,
llcp_addr->service_name_len);
release_sock(sk);

return 0;
}
Expand Down

0 comments on commit f4fa6e6

Please sign in to comment.