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
20 changes: 10 additions & 10 deletions drivers/scsi/lpfc/lpfc_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2607,8 +2607,8 @@ lpfc_debugfs_multixripools_write(struct file *file, const char __user *buf,
struct lpfc_sli4_hdw_queue *qp;
struct lpfc_multixri_pool *multixri_pool;

if (nbytes > 64)
nbytes = 64;
if (nbytes > sizeof(mybuf) - 1)
nbytes = sizeof(mybuf) - 1;

memset(mybuf, 0, sizeof(mybuf));

Expand Down Expand Up @@ -2688,8 +2688,8 @@ lpfc_debugfs_nvmestat_write(struct file *file, const char __user *buf,
if (!phba->targetport)
return -ENXIO;

if (nbytes > 64)
nbytes = 64;
if (nbytes > sizeof(mybuf) - 1)
nbytes = sizeof(mybuf) - 1;

memset(mybuf, 0, sizeof(mybuf));

Expand Down Expand Up @@ -2826,8 +2826,8 @@ lpfc_debugfs_ioktime_write(struct file *file, const char __user *buf,
char mybuf[64];
char *pbuf;

if (nbytes > 64)
nbytes = 64;
if (nbytes > sizeof(mybuf) - 1)
nbytes = sizeof(mybuf) - 1;

memset(mybuf, 0, sizeof(mybuf));

Expand Down Expand Up @@ -2954,8 +2954,8 @@ lpfc_debugfs_nvmeio_trc_write(struct file *file, const char __user *buf,
char mybuf[64];
char *pbuf;

if (nbytes > 64)
nbytes = 64;
if (nbytes > sizeof(mybuf) - 1)
nbytes = sizeof(mybuf) - 1;

memset(mybuf, 0, sizeof(mybuf));

Expand Down Expand Up @@ -3060,8 +3060,8 @@ lpfc_debugfs_hdwqstat_write(struct file *file, const char __user *buf,
char *pbuf;
int i;

if (nbytes > 64)
nbytes = 64;
if (nbytes > sizeof(mybuf) - 1)
nbytes = sizeof(mybuf) - 1;

memset(mybuf, 0, sizeof(mybuf));

Expand Down
7 changes: 3 additions & 4 deletions fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ int inode_init_always(struct super_block *sb, struct inode *inode)

inode->rh_reserved2 = 0;

if (security_inode_alloc(inode))
goto out;
spin_lock_init(&inode->i_lock);
lockdep_set_class(&inode->i_lock, &sb->s_type->i_lock_key);

Expand Down Expand Up @@ -200,11 +198,12 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
inode->i_fsnotify_mask = 0;
#endif
inode->i_flctx = NULL;

if (unlikely(security_inode_alloc(inode)))
return -ENOMEM;
this_cpu_inc(nr_inodes);

return 0;
out:
return -ENOMEM;
}
EXPORT_SYMBOL(inode_init_always);

Expand Down
1 change: 0 additions & 1 deletion include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,6 @@ static inline void __qdisc_reset_queue(struct qdisc_skb_head *qh)
static inline void qdisc_reset_queue(struct Qdisc *sch)
{
__qdisc_reset_queue(&sch->q);
sch->qstats.backlog = 0;
}

static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new,
Expand Down
1 change: 0 additions & 1 deletion net/sched/sch_atm.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ static void atm_tc_reset(struct Qdisc *sch)
pr_debug("atm_tc_reset(sch %p,[qdisc %p])\n", sch, p);
list_for_each_entry(flow, &p->flows, list)
qdisc_reset(flow->q);
sch->q.qlen = 0;
}

static void atm_tc_destroy(struct Qdisc *sch)
Expand Down
1 change: 0 additions & 1 deletion net/sched/sch_cbq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,6 @@ cbq_reset(struct Qdisc *sch)
cl->cpriority = cl->priority;
}
}
sch->q.qlen = 0;
}


Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_choke.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ static void choke_reset(struct Qdisc *sch)
rtnl_qdisc_drop(skb, sch);
}

sch->q.qlen = 0;
sch->qstats.backlog = 0;
if (q->tab)
memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *));
q->head = q->tail = 0;
Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_drr.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,6 @@ static void drr_reset_qdisc(struct Qdisc *sch)
qdisc_reset(cl->qdisc);
}
}
sch->qstats.backlog = 0;
sch->q.qlen = 0;
}

static void drr_destroy_qdisc(struct Qdisc *sch)
Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_dsmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,6 @@ static void dsmark_reset(struct Qdisc *sch)
pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
if (p->q)
qdisc_reset(p->q);
sch->qstats.backlog = 0;
sch->q.qlen = 0;
}

static void dsmark_destroy(struct Qdisc *sch)
Expand Down
3 changes: 0 additions & 3 deletions net/sched/sch_etf.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,6 @@ static void etf_reset(struct Qdisc *sch)
timesortedlist_clear(sch);
__qdisc_reset_queue(&sch->q);

sch->qstats.backlog = 0;
sch->q.qlen = 0;

q->last = 0;
}

Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_ets.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,6 @@ static void ets_qdisc_reset(struct Qdisc *sch)
}
for (band = 0; band < q->nbands; band++)
qdisc_reset(q->classes[band].qdisc);
sch->qstats.backlog = 0;
sch->q.qlen = 0;
}

static void ets_qdisc_destroy(struct Qdisc *sch)
Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_fq_codel.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,6 @@ static void fq_codel_reset(struct Qdisc *sch)
codel_vars_init(&flow->cvars);
}
memset(q->backlogs, 0, q->flows_cnt * sizeof(u32));
sch->q.qlen = 0;
sch->qstats.backlog = 0;
q->memory_usage = 0;
}

Expand Down
3 changes: 0 additions & 3 deletions net/sched/sch_fq_pie.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,6 @@ static void fq_pie_reset(struct Qdisc *sch)
INIT_LIST_HEAD(&flow->flowchain);
pie_vars_init(&flow->vars);
}

sch->q.qlen = 0;
sch->qstats.backlog = 0;
}

static void fq_pie_destroy(struct Qdisc *sch)
Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_hfsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1511,8 +1511,6 @@ hfsc_reset_qdisc(struct Qdisc *sch)
}
q->eligible = RB_ROOT;
qdisc_watchdog_cancel(&q->watchdog);
sch->qstats.backlog = 0;
sch->q.qlen = 0;
}

static void
Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_htb.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,6 @@ static void htb_reset(struct Qdisc *sch)
}
qdisc_watchdog_cancel(&q->watchdog);
__qdisc_reset_queue(&q->direct_queue);
sch->q.qlen = 0;
sch->qstats.backlog = 0;
memset(q->hlevel, 0, sizeof(q->hlevel));
memset(q->row_mask, 0, sizeof(q->row_mask));
}
Expand Down
1 change: 0 additions & 1 deletion net/sched/sch_multiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ multiq_reset(struct Qdisc *sch)

for (band = 0; band < q->bands; band++)
qdisc_reset(q->queues[band]);
sch->q.qlen = 0;
q->curband = 0;
}

Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_prio.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ prio_reset(struct Qdisc *sch)

for (prio = 0; prio < q->bands; prio++)
qdisc_reset(q->queues[prio]);
sch->qstats.backlog = 0;
sch->q.qlen = 0;
}

static int prio_offload(struct Qdisc *sch, struct tc_prio_qopt *qopt)
Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_qfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,8 +1487,6 @@ static void qfq_reset_qdisc(struct Qdisc *sch)
qdisc_reset(cl->qdisc);
}
}
sch->qstats.backlog = 0;
sch->q.qlen = 0;
}

static void qfq_destroy_qdisc(struct Qdisc *sch)
Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_red.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ static void red_reset(struct Qdisc *sch)
struct red_sched_data *q = qdisc_priv(sch);

qdisc_reset(q->qdisc);
sch->qstats.backlog = 0;
sch->q.qlen = 0;
red_restart(&q->vars);
}

Expand Down
5 changes: 2 additions & 3 deletions net/sched/sch_sfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,8 @@ static void sfb_reset(struct Qdisc *sch)
{
struct sfb_sched_data *q = qdisc_priv(sch);

qdisc_reset(q->qdisc);
sch->qstats.backlog = 0;
sch->q.qlen = 0;
if (likely(q->qdisc))
qdisc_reset(q->qdisc);
q->slot = 0;
q->double_buffering = false;
sfb_zero_all_buckets(q);
Expand Down
3 changes: 0 additions & 3 deletions net/sched/sch_skbprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ static void skbprio_reset(struct Qdisc *sch)
struct skbprio_sched_data *q = qdisc_priv(sch);
int prio;

sch->qstats.backlog = 0;
sch->q.qlen = 0;

for (prio = 0; prio < SKBPRIO_MAX_PRIORITY; prio++)
__skb_queue_purge(&q->qdiscs[prio]);

Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_taprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,8 +1658,6 @@ static void taprio_reset(struct Qdisc *sch)
if (q->qdiscs[i])
qdisc_reset(q->qdiscs[i]);
}
sch->qstats.backlog = 0;
sch->q.qlen = 0;
}

static void taprio_destroy(struct Qdisc *sch)
Expand Down
2 changes: 0 additions & 2 deletions net/sched/sch_tbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@ static void tbf_reset(struct Qdisc *sch)
struct tbf_sched_data *q = qdisc_priv(sch);

qdisc_reset(q->qdisc);
sch->qstats.backlog = 0;
sch->q.qlen = 0;
q->t_c = ktime_get_ns();
q->tokens = q->buffer;
q->ptokens = q->mtu;
Expand Down
1 change: 0 additions & 1 deletion net/sched/sch_teql.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ teql_reset(struct Qdisc *sch)
struct teql_sched_data *dat = qdisc_priv(sch);

skb_queue_purge(&dat->q);
sch->q.qlen = 0;
}

static void
Expand Down
25 changes: 22 additions & 3 deletions sound/usb/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,20 +336,28 @@ snd_pcm_chmap_elem *convert_chmap_v3(struct uac3_cluster_header_descriptor

len = le16_to_cpu(cluster->wLength);
c = 0;
p += sizeof(struct uac3_cluster_header_descriptor);
p += sizeof(*cluster);
len -= sizeof(*cluster);

while (((p - (void *)cluster) < len) && (c < channels)) {
while (len > 0 && (c < channels)) {
struct uac3_cluster_segment_descriptor *cs_desc = p;
u16 cs_len;
u8 cs_type;

if (len < sizeof(*cs_desc))
break;
cs_len = le16_to_cpu(cs_desc->wLength);
if (len < cs_len)
break;
cs_type = cs_desc->bSegmentType;

if (cs_type == UAC3_CHANNEL_INFORMATION) {
struct uac3_cluster_information_segment_descriptor *is = p;
unsigned char map;

if (cs_len < sizeof(*is))
break;

/*
* TODO: this conversion is not complete, update it
* after adding UAC3 values to asound.h
Expand Down Expand Up @@ -451,6 +459,7 @@ snd_pcm_chmap_elem *convert_chmap_v3(struct uac3_cluster_header_descriptor
chmap->map[c++] = map;
}
p += cs_len;
len -= cs_len;
}

if (channels < c)
Expand Down Expand Up @@ -870,7 +879,7 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip,
u64 badd_formats = 0;
unsigned int num_channels;
struct audioformat *fp;
u16 cluster_id, wLength;
u16 cluster_id, wLength, cluster_wLength;
int clock = 0;
int err;

Expand Down Expand Up @@ -997,6 +1006,16 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip,
return ERR_PTR(-EIO);
}

cluster_wLength = le16_to_cpu(cluster->wLength);
if (cluster_wLength < sizeof(*cluster) ||
cluster_wLength > wLength) {
dev_err(&dev->dev,
"%u:%d : invalid Cluster Descriptor size\n",
iface_no, altno);
kfree(cluster);
return ERR_PTR(-EIO);
}

num_channels = cluster->bNrChannels;
chmap = convert_chmap_v3(cluster);
kfree(cluster);
Expand Down