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
2 changes: 1 addition & 1 deletion fs/ext4/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ enum {
*
* It's not paranoia if the Murphy's Law really *is* out to get you. :-)
*/
#define TEST_FLAG_VALUE(FLAG) (EXT4_##FLAG##_FL == (1 << EXT4_INODE_##FLAG))
#define TEST_FLAG_VALUE(FLAG) (EXT4_##FLAG##_FL == (1U << EXT4_INODE_##FLAG))
#define CHECK_FLAG_VALUE(FLAG) BUILD_BUG_ON(!TEST_FLAG_VALUE(FLAG))

static inline void ext4_check_flag_values(void)
Expand Down
36 changes: 17 additions & 19 deletions net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4306,6 +4306,12 @@ static int l2cap_connect_create_rsp(struct l2cap_conn *conn,
}
}

chan = l2cap_chan_hold_unless_zero(chan);
if (!chan) {
err = -EBADSLT;
goto unlock;
}

err = 0;

l2cap_chan_lock(chan);
Expand Down Expand Up @@ -4335,6 +4341,7 @@ static int l2cap_connect_create_rsp(struct l2cap_conn *conn,
}

l2cap_chan_unlock(chan);
l2cap_chan_put(chan);

unlock:
mutex_unlock(&conn->chan_lock);
Expand Down Expand Up @@ -4624,33 +4631,29 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn,

BT_DBG("scid 0x%4.4x dcid 0x%4.4x", scid, dcid);

mutex_lock(&conn->chan_lock);

chan = __l2cap_get_chan_by_scid(conn, dcid);
chan = l2cap_get_chan_by_scid(conn, dcid);
if (!chan) {
mutex_unlock(&conn->chan_lock);
cmd_reject_invalid_cid(conn, cmd->ident, dcid, scid);
return 0;
}

l2cap_chan_hold(chan);
l2cap_chan_lock(chan);

rsp.dcid = cpu_to_le16(chan->scid);
rsp.scid = cpu_to_le16(chan->dcid);
l2cap_send_cmd(conn, cmd->ident, L2CAP_DISCONN_RSP, sizeof(rsp), &rsp);

chan->ops->set_shutdown(chan);

l2cap_chan_unlock(chan);
mutex_lock(&conn->chan_lock);
l2cap_chan_lock(chan);
l2cap_chan_del(chan, ECONNRESET);
mutex_unlock(&conn->chan_lock);

chan->ops->close(chan);

l2cap_chan_unlock(chan);
l2cap_chan_put(chan);

mutex_unlock(&conn->chan_lock);

return 0;
}

Expand All @@ -4670,33 +4673,28 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn,

BT_DBG("dcid 0x%4.4x scid 0x%4.4x", dcid, scid);

mutex_lock(&conn->chan_lock);

chan = __l2cap_get_chan_by_scid(conn, scid);
chan = l2cap_get_chan_by_scid(conn, scid);
if (!chan) {
mutex_unlock(&conn->chan_lock);
return 0;
}

l2cap_chan_hold(chan);
l2cap_chan_lock(chan);

if (chan->state != BT_DISCONN) {
l2cap_chan_unlock(chan);
l2cap_chan_put(chan);
mutex_unlock(&conn->chan_lock);
return 0;
}

l2cap_chan_unlock(chan);
mutex_lock(&conn->chan_lock);
l2cap_chan_lock(chan);
l2cap_chan_del(chan, 0);
mutex_unlock(&conn->chan_lock);

chan->ops->close(chan);

l2cap_chan_unlock(chan);
l2cap_chan_put(chan);

mutex_unlock(&conn->chan_lock);

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/ip6mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ static int ip6mr_cache_report(struct mr_table *mrt, struct sk_buff *pkt,
And all this only to mangle msg->im6_msgtype and
to set msg->im6_mbz to "mbz" :-)
*/
skb_push(skb, -skb_network_offset(pkt));
__skb_pull(skb, skb_network_offset(pkt));

skb_push(skb, sizeof(*msg));
skb_reset_transport_header(skb);
Expand Down
4 changes: 4 additions & 0 deletions net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3551,6 +3551,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
break;
goto queue;
case WLAN_CATEGORY_S1G:
if (len < offsetofend(typeof(*mgmt),
u.action.u.s1g.action_code))
break;

switch (mgmt->u.action.u.s1g.action_code) {
case WLAN_S1G_TWT_SETUP:
case WLAN_S1G_TWT_TEARDOWN:
Expand Down
2 changes: 1 addition & 1 deletion net/sctp/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int sctp_rcv(struct sk_buff *skb)
* it's better to just linearize it otherwise crc computing
* takes longer.
*/
if ((!is_gso && skb_linearize(skb)) ||
if (((!is_gso || skb_cloned(skb)) && skb_linearize(skb)) ||
!pskb_may_pull(skb, sizeof(struct sctphdr)))
goto discard_it;

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/hda/patch_ca0132.c
Original file line number Diff line number Diff line change
Expand Up @@ -4398,7 +4398,7 @@ static int add_tuning_control(struct hda_codec *codec,
}
knew.private_value =
HDA_COMPOSE_AMP_VAL(nid, 1, 0, type);
sprintf(namestr, "%s %s Volume", name, dirstr[dir]);
snprintf(namestr, sizeof(namestr), "%s %s Volume", name, dirstr[dir]);
return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
}

Expand Down
12 changes: 12 additions & 0 deletions sound/usb/validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ static bool validate_uac3_feature_unit(const void *p,
return d->bLength >= sizeof(*d) + 4 + 2;
}

static bool validate_uac3_power_domain_unit(const void *p,
const struct usb_desc_validator *v)
{
const struct uac3_power_domain_descriptor *d = p;

if (d->bLength < sizeof(*d))
return false;
/* baEntities[] + wPDomainDescrStr */
return d->bLength >= sizeof(*d) + d->bNrEntities + 2;
}

static bool validate_midi_out_jack(const void *p,
const struct usb_desc_validator *v)
{
Expand Down Expand Up @@ -285,6 +296,7 @@ static const struct usb_desc_validator audio_validators[] = {
struct uac3_clock_multiplier_descriptor),
/* UAC_VERSION_3, UAC3_SAMPLE_RATE_CONVERTER: not implemented yet */
/* UAC_VERSION_3, UAC3_CONNECTORS: not implemented yet */
FUNC(UAC_VERSION_3, UAC3_POWER_DOMAIN, validate_uac3_power_domain_unit),
{ } /* terminator */
};

Expand Down