Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"Some I2C core improvements to prevent NULL pointer usage and a
MAINTAINERS update"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: slave: add sanity check when unregistering
i2c: slave: improve sanity check when registering
MAINTAINERS: Update GENI I2C maintainers list
i2c: also convert placeholder function to return errno

+7 -5
+2 -1
MAINTAINERS
··· 14188 14188 F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c 14189 14189 14190 14190 QUALCOMM GENERIC INTERFACE I2C DRIVER 14191 - M: Alok Chauhan <alokc@codeaurora.org> 14191 + M: Akash Asthana <akashast@codeaurora.org> 14192 + M: Mukesh Savaliya <msavaliy@codeaurora.org> 14192 14193 L: linux-i2c@vger.kernel.org 14193 14194 L: linux-arm-msm@vger.kernel.org 14194 14195 S: Supported
+4 -3
drivers/i2c/i2c-core-slave.c
··· 18 18 { 19 19 int ret; 20 20 21 - if (!client || !slave_cb) { 22 - WARN(1, "insufficient data\n"); 21 + if (WARN(IS_ERR_OR_NULL(client) || !slave_cb, "insufficient data\n")) 23 22 return -EINVAL; 24 - } 25 23 26 24 if (!(client->flags & I2C_CLIENT_SLAVE)) 27 25 dev_warn(&client->dev, "%s: client slave flag not set. You might see address collisions\n", ··· 57 59 int i2c_slave_unregister(struct i2c_client *client) 58 60 { 59 61 int ret; 62 + 63 + if (IS_ERR_OR_NULL(client)) 64 + return -EINVAL; 60 65 61 66 if (!client->adapter->algo->unreg_slave) { 62 67 dev_err(&client->dev, "%s: not supported by adapter\n", __func__);
+1 -1
include/linux/i2c.h
··· 1001 1001 static inline struct i2c_client *i2c_acpi_new_device(struct device *dev, 1002 1002 int index, struct i2c_board_info *info) 1003 1003 { 1004 - return NULL; 1004 + return ERR_PTR(-ENODEV); 1005 1005 } 1006 1006 static inline struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle) 1007 1007 {