Skip to content

Commit

Permalink
Merge 4.19.192 into android-4.19-stable
Browse files Browse the repository at this point in the history
Changes in 4.19.192
	firmware: arm_scpi: Prevent the ternary sign expansion bug
	openrisc: Fix a memory leak
	RDMA/rxe: Clear all QP fields if creation failed
	scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword()
	RDMA/mlx5: Recover from fatal event in dual port mode
	platform/x86: dell-smbios-wmi: Fix oops on rmmod dell_smbios
	ptrace: make ptrace() fail if the tracee changed its pid unexpectedly
	nvmet: seset ns->file when open fails
	locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal
	cifs: fix memory leak in smb2_copychunk_range
	ALSA: dice: fix stream format for TC Electronic Konnekt Live at high sampling transfer frequency
	ALSA: line6: Fix racy initialization of LINE6 MIDI
	ALSA: dice: fix stream format at middle sampling rate for Alesis iO 26
	ALSA: usb-audio: Validate MS endpoint descriptors
	ALSA: bebob/oxfw: fix Kconfig entry for Mackie d.2 Pro
	Revert "ALSA: sb8: add a check for request_region"
	ALSA: hda/realtek: reset eapd coeff to default value for alc287
	ALSA: hda/realtek: Add some CLOVE SSIDs of ALC293
	Revert "rapidio: fix a NULL pointer dereference when create_workqueue() fails"
	rapidio: handle create_workqueue() failure
	Revert "serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference"
	xen-pciback: reconfigure also from backend watch handler
	dm snapshot: fix crash with transient storage and zero chunk size
	Revert "video: hgafb: fix potential NULL pointer dereference"
	Revert "net: stmicro: fix a missing check of clk_prepare"
	Revert "leds: lp5523: fix a missing check of return value of lp55xx_read"
	Revert "hwmon: (lm80) fix a missing check of bus read in lm80 probe"
	Revert "video: imsttfb: fix potential NULL pointer dereferences"
	Revert "ecryptfs: replace BUG_ON with error handling code"
	Revert "scsi: ufs: fix a missing check of devm_reset_control_get"
	Revert "gdrom: fix a memory leak bug"
	cdrom: gdrom: deallocate struct gdrom_unit fields in remove_gdrom
	cdrom: gdrom: initialize global variable at init time
	Revert "media: rcar_drif: fix a memory disclosure"
	Revert "rtlwifi: fix a potential NULL pointer dereference"
	Revert "qlcnic: Avoid potential NULL pointer dereference"
	Revert "niu: fix missing checks of niu_pci_eeprom_read"
	ethernet: sun: niu: fix missing checks of niu_pci_eeprom_read()
	net: stmicro: handle clk_prepare() failure during init
	scsi: ufs: handle cleanup correctly on devm_reset_control_get error
	net: rtlwifi: properly check for alloc_workqueue() failure
	leds: lp5523: check return value of lp5xx_read and jump to cleanup code
	qlcnic: Add null check after calling netdev_alloc_skb
	video: hgafb: fix potential NULL pointer dereference
	vgacon: Record video mode changes with VT_RESIZEX
	vt: Fix character height handling with VT_RESIZEX
	tty: vt: always invoke vc->vc_sw->con_resize callback
	video: hgafb: correctly handle card detect failure during probe
	Bluetooth: SMP: Fail if remote and local public keys are identical
	Linux 4.19.192

Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I120d11a184c53fb969144fd232ca11098f61d6d6
  • Loading branch information
gregkh committed May 31, 2021
2 parents 8ff7a6b + 6b7b005 commit 4859212
Show file tree
Hide file tree
Showing 47 changed files with 236 additions and 153 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 19
SUBLEVEL = 191
SUBLEVEL = 192
EXTRAVERSION =
NAME = "People's Front"

Expand Down
2 changes: 2 additions & 0 deletions arch/openrisc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ void calibrate_delay(void)
pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
loops_per_jiffy / (500000 / HZ),
(loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);

of_node_put(cpu);
}

void __init setup_arch(char **cmdline_p)
Expand Down
13 changes: 10 additions & 3 deletions drivers/cdrom/gdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,13 @@ static int probe_gdrom_setupqueue(void)
static int probe_gdrom(struct platform_device *devptr)
{
int err;

/*
* Ensure our "one" device is initialized properly in case of previous
* usages of it
*/
memset(&gd, 0, sizeof(gd));

/* Start the device */
if (gdrom_execute_diagnostic() != 1) {
pr_warning("ATA Probe for GDROM failed\n");
Expand Down Expand Up @@ -857,6 +864,8 @@ static int remove_gdrom(struct platform_device *devptr)
if (gdrom_major)
unregister_blkdev(gdrom_major, GDROM_DEV_NAME);
unregister_cdrom(gd.cd_info);
kfree(gd.cd_info);
kfree(gd.toc);

return 0;
}
Expand All @@ -872,7 +881,7 @@ static struct platform_driver gdrom_driver = {
static int __init init_gdrom(void)
{
int rc;
gd.toc = NULL;

rc = platform_driver_register(&gdrom_driver);
if (rc)
return rc;
Expand All @@ -888,8 +897,6 @@ static void __exit exit_gdrom(void)
{
platform_device_unregister(pd);
platform_driver_unregister(&gdrom_driver);
kfree(gd.toc);
kfree(gd.cd_info);
}

module_init(init_gdrom);
Expand Down
4 changes: 3 additions & 1 deletion drivers/firmware/arm_scpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,10 @@ static unsigned long scpi_clk_get_val(u16 clk_id)

ret = scpi_send_message(CMD_GET_CLOCK_VALUE, &le_clk_id,
sizeof(le_clk_id), &rate, sizeof(rate));
if (ret)
return 0;

return ret ? ret : le32_to_cpu(rate);
return le32_to_cpu(rate);
}

static int scpi_clk_set_val(u16 clk_id, unsigned long rate)
Expand Down
11 changes: 2 additions & 9 deletions drivers/hwmon/lm80.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ static int lm80_probe(struct i2c_client *client,
struct device *dev = &client->dev;
struct device *hwmon_dev;
struct lm80_data *data;
int rv;

data = devm_kzalloc(dev, sizeof(struct lm80_data), GFP_KERNEL);
if (!data)
Expand All @@ -643,14 +642,8 @@ static int lm80_probe(struct i2c_client *client,
lm80_init_client(client);

/* A few vars need to be filled upon startup */
rv = lm80_read_value(client, LM80_REG_FAN_MIN(1));
if (rv < 0)
return rv;
data->fan[f_min][0] = rv;
rv = lm80_read_value(client, LM80_REG_FAN_MIN(2));
if (rv < 0)
return rv;
data->fan[f_min][1] = rv;
data->fan[f_min][0] = lm80_read_value(client, LM80_REG_FAN_MIN(1));
data->fan[f_min][1] = lm80_read_value(client, LM80_REG_FAN_MIN(2));

hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
data, lm80_groups);
Expand Down
1 change: 1 addition & 0 deletions drivers/infiniband/hw/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6339,6 +6339,7 @@ static void *mlx5_ib_add_slave_port(struct mlx5_core_dev *mdev)

if (bound) {
rdma_roce_rescan_device(&dev->ib_dev);
mpi->ibdev->ib_active = true;
break;
}
}
Expand Down
7 changes: 7 additions & 0 deletions drivers/infiniband/sw/rxe/rxe_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
if (err) {
vfree(qp->sq.queue->buf);
kfree(qp->sq.queue);
qp->sq.queue = NULL;
return err;
}

Expand Down Expand Up @@ -303,6 +304,7 @@ static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp,
if (err) {
vfree(qp->rq.queue->buf);
kfree(qp->rq.queue);
qp->rq.queue = NULL;
return err;
}
}
Expand Down Expand Up @@ -363,6 +365,11 @@ int rxe_qp_from_init(struct rxe_dev *rxe, struct rxe_qp *qp, struct rxe_pd *pd,
err2:
rxe_queue_cleanup(qp->sq.queue);
err1:
qp->pd = NULL;
qp->rcq = NULL;
qp->scq = NULL;
qp->srq = NULL;

if (srq)
rxe_drop_ref(srq);
rxe_drop_ref(scq);
Expand Down
2 changes: 1 addition & 1 deletion drivers/leds/leds-lp5523.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip)
usleep_range(3000, 6000);
ret = lp55xx_read(chip, LP5523_REG_STATUS, &status);
if (ret)
return ret;
goto out;
status &= LP5523_ENG_STATUS_MASK;

if (status != LP5523_ENG_STATUS_MASK) {
Expand Down
1 change: 1 addition & 0 deletions drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)

if (!s->store->chunk_size) {
ti->error = "Chunk size not set";
r = -EINVAL;
goto bad_read_metadata;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/media/platform/rcar_drif.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,6 @@ static int rcar_drif_g_fmt_sdr_cap(struct file *file, void *priv,
{
struct rcar_drif_sdr *sdr = video_drvdata(file);

memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
f->fmt.sdr.pixelformat = sdr->fmt->pixelformat;
f->fmt.sdr.buffersize = sdr->fmt->buffersize;

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) {
skb = netdev_alloc_skb(adapter->netdev, QLCNIC_ILB_PKT_SIZE);
if (!skb)
break;
goto error;
qlcnic_create_loopback_buff(skb->data, adapter->mac_addr);
skb_put(skb, QLCNIC_ILB_PKT_SIZE);
adapter->ahw->diag_cnt = 0;
Expand All @@ -1073,6 +1073,7 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
cnt++;
}
if (cnt != i) {
error:
dev_err(&adapter->pdev->dev,
"LB Test: failed, TX[%d], RX[%d]\n", i, cnt);
if (mode != QLCNIC_ILB_MODE)
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct sunxi_priv_data {
static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
{
struct sunxi_priv_data *gmac = priv;
int ret;
int ret = 0;

if (gmac->regulator) {
ret = regulator_enable(gmac->regulator);
Expand All @@ -60,11 +60,11 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
} else {
clk_set_rate(gmac->tx_clk, SUN7I_GMAC_MII_RATE);
ret = clk_prepare(gmac->tx_clk);
if (ret)
return ret;
if (ret && gmac->regulator)
regulator_disable(gmac->regulator);
}

return 0;
return ret;
}

static void sun7i_gmac_exit(struct platform_device *pdev, void *priv)
Expand Down
32 changes: 20 additions & 12 deletions drivers/net/ethernet/sun/niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -8145,10 +8145,10 @@ static int niu_pci_vpd_scan_props(struct niu *np, u32 start, u32 end)
"VPD_SCAN: Reading in property [%s] len[%d]\n",
namebuf, prop_len);
for (i = 0; i < prop_len; i++) {
err = niu_pci_eeprom_read(np, off + i);
if (err >= 0)
*prop_buf = err;
++prop_buf;
err = niu_pci_eeprom_read(np, off + i);
if (err < 0)
return err;
*prop_buf++ = err;
}
}

Expand All @@ -8159,14 +8159,14 @@ static int niu_pci_vpd_scan_props(struct niu *np, u32 start, u32 end)
}

/* ESPC_PIO_EN_ENABLE must be set */
static void niu_pci_vpd_fetch(struct niu *np, u32 start)
static int niu_pci_vpd_fetch(struct niu *np, u32 start)
{
u32 offset;
int err;

err = niu_pci_eeprom_read16_swp(np, start + 1);
if (err < 0)
return;
return err;

offset = err + 3;

Expand All @@ -8175,22 +8175,27 @@ static void niu_pci_vpd_fetch(struct niu *np, u32 start)
u32 end;

err = niu_pci_eeprom_read(np, here);
if (err < 0)
return err;
if (err != 0x90)
return;
return -EINVAL;

err = niu_pci_eeprom_read16_swp(np, here + 1);
if (err < 0)
return;
return err;

here = start + offset + 3;
end = start + offset + err;

offset += err;

err = niu_pci_vpd_scan_props(np, here, end);
if (err < 0 || err == 1)
return;
if (err < 0)
return err;
if (err == 1)
return -EINVAL;
}
return 0;
}

/* ESPC_PIO_EN_ENABLE must be set */
Expand Down Expand Up @@ -9281,8 +9286,11 @@ static int niu_get_invariants(struct niu *np)
offset = niu_pci_vpd_offset(np);
netif_printk(np, probe, KERN_DEBUG, np->dev,
"%s() VPD offset [%08x]\n", __func__, offset);
if (offset)
niu_pci_vpd_fetch(np, offset);
if (offset) {
err = niu_pci_vpd_fetch(np, offset);
if (err < 0)
return err;
}
nw64(ESPC_PIO_EN, 0);

if (np->flags & NIU_FLAGS_VPD_VALID) {
Expand Down
19 changes: 9 additions & 10 deletions drivers/net/wireless/realtek/rtlwifi/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,14 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
}
}

static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
static int _rtl_init_deferred_work(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct workqueue_struct *wq;

wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
if (!wq)
return -ENOMEM;

/* <1> timer */
timer_setup(&rtlpriv->works.watchdog_timer,
Expand All @@ -468,11 +473,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
rtl_easy_concurrent_retrytimer_callback, 0);
/* <2> work queue */
rtlpriv->works.hw = hw;
rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
if (unlikely(!rtlpriv->works.rtl_wq)) {
pr_err("Failed to allocate work queue\n");
return;
}
rtlpriv->works.rtl_wq = wq;

INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
(void *)rtl_watchdog_wq_callback);
Expand All @@ -486,7 +487,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
(void *)rtl_fwevt_wq_callback);
INIT_DELAYED_WORK(&rtlpriv->works.c2hcmd_wq,
(void *)rtl_c2hcmd_wq_callback);

return 0;
}

void rtl_deinit_deferred_work(struct ieee80211_hw *hw, bool ips_wq)
Expand Down Expand Up @@ -586,9 +587,7 @@ int rtl_init_core(struct ieee80211_hw *hw)
rtlmac->link_state = MAC80211_NOLINK;

/* <6> init deferred work */
_rtl_init_deferred_work(hw);

return 0;
return _rtl_init_deferred_work(hw);
}
EXPORT_SYMBOL_GPL(rtl_init_core);

Expand Down
8 changes: 5 additions & 3 deletions drivers/nvme/target/io-cmd-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ int nvmet_file_ns_enable(struct nvmet_ns *ns)

ns->file = filp_open(ns->device_path, flags, 0);
if (IS_ERR(ns->file)) {
pr_err("failed to open file %s: (%ld)\n",
ns->device_path, PTR_ERR(ns->file));
return PTR_ERR(ns->file);
ret = PTR_ERR(ns->file);
pr_err("failed to open file %s: (%d)\n",
ns->device_path, ret);
ns->file = NULL;
return ret;
}

ret = vfs_getattr(&ns->file->f_path,
Expand Down
3 changes: 2 additions & 1 deletion drivers/platform/x86/dell-smbios-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ int init_dell_smbios_wmi(void)

void exit_dell_smbios_wmi(void)
{
wmi_driver_unregister(&dell_smbios_wmi_driver);
if (wmi_supported)
wmi_driver_unregister(&dell_smbios_wmi_driver);
}

MODULE_ALIAS("wmi:" DELL_WMI_SMBIOS_GUID);
17 changes: 8 additions & 9 deletions drivers/rapidio/rio_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2136,6 +2136,14 @@ static int riocm_add_mport(struct device *dev,
return -ENODEV;
}

cm->rx_wq = create_workqueue(DRV_NAME "/rxq");
if (!cm->rx_wq) {
rio_release_inb_mbox(mport, cmbox);
rio_release_outb_mbox(mport, cmbox);
kfree(cm);
return -ENOMEM;
}

/*
* Allocate and register inbound messaging buffers to be ready
* to receive channel and system management requests
Expand All @@ -2146,15 +2154,6 @@ static int riocm_add_mport(struct device *dev,
cm->rx_slots = RIOCM_RX_RING_SIZE;
mutex_init(&cm->rx_lock);
riocm_rx_fill(cm, RIOCM_RX_RING_SIZE);
cm->rx_wq = create_workqueue(DRV_NAME "/rxq");
if (!cm->rx_wq) {
riocm_error("failed to allocate IBMBOX_%d on %s",
cmbox, mport->name);
rio_release_outb_mbox(mport, cmbox);
kfree(cm);
return -ENOMEM;
}

INIT_WORK(&cm->rx_work, rio_ibmsg_handler);

cm->tx_slot = 0;
Expand Down
3 changes: 2 additions & 1 deletion drivers/scsi/qla2xxx/qla_nx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,8 @@ qla82xx_write_flash_dword(struct qla_hw_data *ha, uint32_t flashaddr,
return ret;
}

if (qla82xx_flash_set_write_enable(ha))
ret = qla82xx_flash_set_write_enable(ha);
if (ret < 0)
goto done_write;

qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_WDATA, data);
Expand Down
Loading

0 comments on commit 4859212

Please sign in to comment.