Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion arch/arm64/kernel/cacheinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,

static int __init_cache_level(unsigned int cpu)
{
unsigned int ctype, level, leaves, fw_level;
unsigned int ctype, level, leaves;
int fw_level;
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);

for (level = 1, leaves = 0; level <= MAX_CACHE_LEVEL; level++) {
Expand All @@ -74,6 +75,9 @@ static int __init_cache_level(unsigned int cpu)
else
fw_level = acpi_find_last_cache_level(cpu);

if (fw_level < 0)
return fw_level;

if (level < fw_level) {
/*
* some external caches not specified in CLIDR_EL1
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@ void optc1_enable_optc_clock(struct timing_generator *optc, bool enable)
OTG_CLOCK_ON, 1,
1, 1000);
} else {

//last chance to clear underflow, otherwise, it will always there due to clock is off.
if (optc->funcs->is_optc_underflow_occurred(optc) == true)
optc->funcs->clear_optc_underflow(optc);

REG_UPDATE_2(OTG_CLOCK_CONTROL,
OTG_CLOCK_GATE_DIS, 0,
OTG_CLOCK_EN, 0);
Expand Down
16 changes: 9 additions & 7 deletions drivers/gpu/drm/i915/display/intel_bw.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,17 @@ static int tgl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel
int clpchgroup;
int j;

if (i < num_groups - 1)
bi_next = &dev_priv->max_bw[i + 1];

clpchgroup = (sa->deburst * qi.deinterleave / num_channels) << i;

if (i < num_groups - 1 && clpchgroup < clperchgroup)
bi_next->num_planes = (ipqdepth - clpchgroup) / clpchgroup + 1;
else
bi_next->num_planes = 0;
if (i < num_groups - 1) {
bi_next = &dev_priv->max_bw[i + 1];

if (clpchgroup < clperchgroup)
bi_next->num_planes = (ipqdepth - clpchgroup) /
clpchgroup + 1;
else
bi_next->num_planes = 0;
}

bi->num_qgv_points = qi.num_points;
bi->num_psf_gv_points = qi.num_psf_points;
Expand Down
2 changes: 2 additions & 0 deletions drivers/misc/vmw_vmci/vmci_queue_pair.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ static int qp_notify_peer_local(bool attach, struct vmci_handle handle)
u32 context_id = vmci_get_context_id();
struct vmci_event_qp ev;

memset(&ev, 0, sizeof(ev));
ev.msg.hdr.dst = vmci_make_handle(context_id, VMCI_EVENT_HANDLER);
ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,
VMCI_CONTEXT_RESOURCE_ID);
Expand Down Expand Up @@ -1467,6 +1468,7 @@ static int qp_notify_peer(bool attach,
* kernel.
*/

memset(&ev, 0, sizeof(ev));
ev.msg.hdr.dst = vmci_make_handle(peer_id, VMCI_EVENT_HANDLER);
ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,
VMCI_CONTEXT_RESOURCE_ID);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ mt76_sta_add(struct mt76_dev *dev, struct ieee80211_vif *vif,
continue;

mtxq = (struct mt76_txq *)sta->txq[i]->drv_priv;
mtxq->wcid = wcid;
mtxq->wcid = wcid->idx;
}

ewma_signal_init(&wcid->rssi);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt76.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ struct mt76_wcid {
};

struct mt76_txq {
struct mt76_wcid *wcid;
u16 wcid;

u16 agg_ssn;
bool send_bar;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7603/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ mt7603_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
mt7603_wtbl_init(dev, idx, mvif->idx, bc_addr);

mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = &mvif->sta.wcid;
mtxq->wcid = idx;
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);

out:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7615/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static int mt7615_add_interface(struct ieee80211_hw *hw,
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
if (vif->txq) {
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = &mvif->sta.wcid;
mtxq->wcid = idx;
}

ret = mt7615_mcu_add_dev_info(phy, vif, true);
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt76x02_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif,
mt76_packet_id_init(&mvif->group_wcid);

mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = &mvif->group_wcid;
rcu_assign_pointer(dev->mt76.wcid[MT_VIF_WCID(idx)], &mvif->group_wcid);
mtxq->wcid = MT_VIF_WCID(idx);
}

int
Expand Down Expand Up @@ -345,6 +346,7 @@ void mt76x02_remove_interface(struct ieee80211_hw *hw,
struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;

dev->mt76.vif_mask &= ~BIT(mvif->idx);
rcu_assign_pointer(dev->mt76.wcid[mvif->group_wcid.idx], NULL);
mt76_packet_id_flush(&dev->mt76, &mvif->group_wcid);
}
EXPORT_SYMBOL_GPL(mt76x02_remove_interface);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7915/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
if (vif->txq) {
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = &mvif->sta.wcid;
mtxq->wcid = idx;
}

if (vif->type != NL80211_IFTYPE_AP &&
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7921/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static int mt7921_add_interface(struct ieee80211_hw *hw,
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
if (vif->txq) {
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = &mvif->sta.wcid;
mtxq->wcid = idx;
}

out:
Expand Down
9 changes: 4 additions & 5 deletions drivers/net/wireless/mediatek/mt76/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,11 @@ mt76_txq_stopped(struct mt76_queue *q)

static int
mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q,
struct mt76_txq *mtxq)
struct mt76_txq *mtxq, struct mt76_wcid *wcid)
{
struct mt76_dev *dev = phy->dev;
struct ieee80211_txq *txq = mtxq_to_txq(mtxq);
enum mt76_txq_id qid = mt76_txq_get_qid(txq);
struct mt76_wcid *wcid = mtxq->wcid;
struct ieee80211_tx_info *info;
struct sk_buff *skb;
int n_frames = 1;
Expand Down Expand Up @@ -521,8 +520,8 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid)
break;

mtxq = (struct mt76_txq *)txq->drv_priv;
wcid = mtxq->wcid;
if (wcid && test_bit(MT_WCID_FLAG_PS, &wcid->flags))
wcid = rcu_dereference(dev->wcid[mtxq->wcid]);
if (!wcid || test_bit(MT_WCID_FLAG_PS, &wcid->flags))
continue;

spin_lock_bh(&q->lock);
Expand All @@ -541,7 +540,7 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid)
}

if (!mt76_txq_stopped(q))
n_frames = mt76_txq_send_burst(phy, q, mtxq);
n_frames = mt76_txq_send_burst(phy, q, mtxq, wcid);

spin_unlock_bh(&q->lock);

Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/realtek/rtw89/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2213,6 +2213,11 @@ void rtw89_phy_cfo_parse(struct rtw89_dev *rtwdev, s16 cfo_val,
struct rtw89_cfo_tracking_info *cfo = &rtwdev->cfo_tracking;
u8 macid = phy_ppdu->mac_id;

if (macid >= CFO_TRACK_MAX_USER) {
rtw89_warn(rtwdev, "mac_id %d is out of range\n", macid);
return;
}

cfo->cfo_tail[macid] += cfo_val;
cfo->cfo_cnt[macid]++;
cfo->packet_count++;
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/libfc/fc_exch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,7 @@ static void fc_exch_abts_resp(struct fc_exch *ep, struct fc_frame *fp)
if (cancel_delayed_work_sync(&ep->timeout_work)) {
FC_EXCH_DBG(ep, "Exchange timer canceled due to ABTS response\n");
fc_exch_release(ep); /* release from pending timer hold */
return;
}

spin_lock_bh(&ep->ex_lock);
Expand Down
11 changes: 8 additions & 3 deletions drivers/usb/host/xhci-plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,17 @@ static int xhci_plat_remove(struct platform_device *dev)
pm_runtime_get_sync(&dev->dev);
xhci->xhc_state |= XHCI_STATE_REMOVING;

usb_remove_hcd(shared_hcd);
xhci->shared_hcd = NULL;
if (shared_hcd) {
usb_remove_hcd(shared_hcd);
xhci->shared_hcd = NULL;
}

usb_phy_shutdown(hcd->usb_phy);

usb_remove_hcd(hcd);
usb_put_hcd(shared_hcd);

if (shared_hcd)
usb_put_hcd(shared_hcd);

clk_disable_unprepare(clk);
clk_disable_unprepare(reg_clk);
Expand Down
3 changes: 3 additions & 0 deletions fs/cifs/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ parse_mf_symlink(const u8 *buf, unsigned int buf_len, unsigned int *_link_len,
if (rc != 1)
return -EINVAL;

if (link_len > CIFS_MF_SYMLINK_LINK_MAXLEN)
return -EINVAL;

rc = symlink_hash(link_len, link_str, md5_hash);
if (rc) {
cifs_dbg(FYI, "%s: MD5 hash failure: %d\n", __func__, rc);
Expand Down
10 changes: 10 additions & 0 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2833,6 +2833,16 @@ int ftrace_startup(struct ftrace_ops *ops, int command)

ftrace_startup_enable(command);

/*
* If ftrace is in an undefined state, we just remove ops from list
* to prevent the NULL pointer, instead of totally rolling it back and
* free trampoline, because those actions could cause further damage.
*/
if (unlikely(ftrace_disabled)) {
__unregister_ftrace_function(ops);
return -ENODEV;
}

ops->flags &= ~FTRACE_OPS_FL_ADDING;

return 0;
Expand Down
3 changes: 2 additions & 1 deletion net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -5099,8 +5099,9 @@ static void hci_disconn_phylink_complete_evt(struct hci_dev *hdev,
hci_dev_lock(hdev);

hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle);
if (hcon) {
if (hcon && hcon->type == AMP_LINK) {
hcon->state = BT_CLOSED;
hci_disconn_cfm(hcon, ev->reason);
hci_conn_del(hcon);
}

Expand Down
7 changes: 2 additions & 5 deletions net/mac80211/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1749,12 +1749,9 @@ int ieee80211_vif_use_reserved_context(struct ieee80211_sub_if_data *sdata)

if (new_ctx->replace_state == IEEE80211_CHANCTX_REPLACE_NONE) {
if (old_ctx)
err = ieee80211_vif_use_reserved_reassign(sdata);
else
err = ieee80211_vif_use_reserved_assign(sdata);
return ieee80211_vif_use_reserved_reassign(sdata);

if (err)
return err;
return ieee80211_vif_use_reserved_assign(sdata);
}

/*
Expand Down