From: Greg Kroah-Hartman Date: Thu, 30 Apr 2020 14:45:46 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v5.4.37~40 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=f12d61a6d320db7b8f205e9bd5edec737010db9f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: i2c-altera-use-proper-variable-to-hold-errno.patch net-cxgb4-check-the-return-from-t4_query_params-properly.patch --- diff --git a/queue-4.14/i2c-altera-use-proper-variable-to-hold-errno.patch b/queue-4.14/i2c-altera-use-proper-variable-to-hold-errno.patch new file mode 100644 index 00000000000..80faee3ac83 --- /dev/null +++ b/queue-4.14/i2c-altera-use-proper-variable-to-hold-errno.patch @@ -0,0 +1,54 @@ +From edb2c9dd3948738ef030c32b948543e84f4d3f81 Mon Sep 17 00:00:00 2001 +From: Wolfram Sang +Date: Fri, 27 Mar 2020 23:28:26 +0100 +Subject: i2c: altera: use proper variable to hold errno + +From: Wolfram Sang + +commit edb2c9dd3948738ef030c32b948543e84f4d3f81 upstream. + +device_property_read_u32() returns errno or 0, so we should use the +integer variable 'ret' and not the u32 'val' to hold the retval. + +Fixes: 0560ad576268 ("i2c: altera: Add Altera I2C Controller driver") +Signed-off-by: Wolfram Sang +Reviewed-by: Thor Thayer +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-altera.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/drivers/i2c/busses/i2c-altera.c ++++ b/drivers/i2c/busses/i2c-altera.c +@@ -395,7 +395,6 @@ static int altr_i2c_probe(struct platfor + struct altr_i2c_dev *idev = NULL; + struct resource *res; + int irq, ret; +- u32 val; + + idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL); + if (!idev) +@@ -422,17 +421,17 @@ static int altr_i2c_probe(struct platfor + init_completion(&idev->msg_complete); + spin_lock_init(&idev->lock); + +- val = device_property_read_u32(idev->dev, "fifo-size", ++ ret = device_property_read_u32(idev->dev, "fifo-size", + &idev->fifo_size); +- if (val) { ++ if (ret) { + dev_err(&pdev->dev, "FIFO size set to default of %d\n", + ALTR_I2C_DFLT_FIFO_SZ); + idev->fifo_size = ALTR_I2C_DFLT_FIFO_SZ; + } + +- val = device_property_read_u32(idev->dev, "clock-frequency", ++ ret = device_property_read_u32(idev->dev, "clock-frequency", + &idev->bus_clk_rate); +- if (val) { ++ if (ret) { + dev_err(&pdev->dev, "Default to 100kHz\n"); + idev->bus_clk_rate = 100000; /* default clock rate */ + } diff --git a/queue-4.14/net-cxgb4-check-the-return-from-t4_query_params-properly.patch b/queue-4.14/net-cxgb4-check-the-return-from-t4_query_params-properly.patch new file mode 100644 index 00000000000..3c256e20ea9 --- /dev/null +++ b/queue-4.14/net-cxgb4-check-the-return-from-t4_query_params-properly.patch @@ -0,0 +1,39 @@ +From c799fca8baf18d1bbbbad6c3b736eefbde8bdb90 Mon Sep 17 00:00:00 2001 +From: Jason Gunthorpe +Date: Tue, 14 Apr 2020 12:27:08 -0300 +Subject: net/cxgb4: Check the return from t4_query_params properly +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jason Gunthorpe + +commit c799fca8baf18d1bbbbad6c3b736eefbde8bdb90 upstream. + +Positive return values are also failures that don't set val, +although this probably can't happen. Fixes gcc 10 warning: + +drivers/net/ethernet/chelsio/cxgb4/t4_hw.c: In function ‘t4_phy_fw_ver’: +drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:3747:14: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized] + 3747 | *phy_fw_ver = val; + +Fixes: 01b6961410b7 ("cxgb4: Add PHY firmware support for T420-BT cards") +Signed-off-by: Jason Gunthorpe +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +@@ -3609,7 +3609,7 @@ int t4_phy_fw_ver(struct adapter *adap, + FW_PARAMS_PARAM_Z_V(FW_PARAMS_PARAM_DEV_PHYFW_VERSION)); + ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, + ¶m, &val); +- if (ret < 0) ++ if (ret) + return ret; + *phy_fw_ver = val; + return 0; diff --git a/queue-4.14/series b/queue-4.14/series index 6a634f92dc2..e0da8f83675 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -90,3 +90,5 @@ usb-dwc3-gadget-do-link-recovery-for-ss-and-ssp.patch usb-gadget-udc-bdc-remove-unnecessary-null-checks-in-bdc_req_complete.patch iio-ad7797-use-correct-attribute_group.patch nfsd-memory-corruption-in-nfsd4_lock.patch +i2c-altera-use-proper-variable-to-hold-errno.patch +net-cxgb4-check-the-return-from-t4_query_params-properly.patch