Linux 3.18.117
Greg KH
maintainerI'm announcing the release of the 3.18.117 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 3 arch/arc/include/asm/page.h | 2 arch/arc/include/asm/pgtable.h | 2 arch/arm/include/asm/uaccess.h | 2 arch/x86/kernel/cpu/mcheck/mce.c | 3 drivers/net/can/xilinx_can.c | 98 +++++++++++++----- drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 2 drivers/ptp/ptp_chardev.c | 1 drivers/usb/class/cdc-acm.c | 3 drivers/usb/core/hub.c | 8 + drivers/usb/gadget/function/f_fs.c | 2 fs/fat/inode.c | 20 ++- include/linux/skbuff.h | 12 +- include/net/tcp.h | 2 net/core/rtnetlink.c | 9 + net/core/skbuff.c | 1 net/ipv4/ip_output.c | 2 net/ipv4/sysctl_net_ipv4.c | 5 net/ipv4/tcp_dctcp.c | 50 ++------- net/ipv4/tcp_input.c | 22 +++- net/ipv4/tcp_output.c | 33 ++++-- net/ipv6/ip6_output.c | 2 sound/core/rawmidi.c | 20 ++- 23 files changed, 198 insertions(+), 106 deletions(-)
Alexey Brodkin (1):
ARC: Fix CONFIG_SWAP
Anssi Hannula (4):
can: xilinx_can: fix RX loop if RXNEMP is asserted without RXOK
can: xilinx_can: fix device dropping off bus on RX overrun
can: xilinx_can: keep only 1-2 frames in TX FIFO to fix TX accounting
can: xilinx_can: fix RX overflow interrupt not being enabled
Arnd Bergmann (2):
ARM: fix put_user() for gcc-8
turn off -Wattribute-alias
Bin Liu (1):
usb: core: handle hub C_PORT_OVER_CURRENT condition
Dewet Thibaut (1):
x86/MCE: Remove min interval polling limitation
Eric Dumazet (2):
tcp: avoid collapses in tcp_prune_queue() if possible
tcp: detect malicious patterns in tcp_collapse_ofo_queue()
Greg Kroah-Hartman (1):
Linux 3.18.117
Gustavo A. R. Silva (1):
ptp: fix missing break in switch
Jack Morgenstein (1):
net/mlx4_core: Save the qpn from the input modifier in RST2INIT wrapper
Jerry Zhang (1):
usb: gadget: f_fs: Only return delayed status when len is 0
Lubomir Rintel (1):
usb: cdc_acm: Add quirk for Castles VEGA3000
OGAWA Hirofumi (1):
fat: fix memory allocation failure handling of match_strdup()
Paolo Abeni (1):
ip: hash fragments consistently
Roopa Prabhu (1):
rtnetlink: add rtnl_link_state check in rtnl_configure_link
Stefano Brivio (2):
net: Don't copy pfmemalloc flag in __copy_skb_header()
skbuff: Unconditionally copy pfmemalloc in __skb_clone()
Takashi Iwai (1):
ALSA: rawmidi: Change resized buffers atomically
Tyler Hicks (1):
ipv4: Return EINVAL when ping_group_range sysctl doesn't map to user ns
Vineet Gupta (1):
ARC: mm: allow mprotect to make stack mappings executable
Yuchung Cheng (4):
tcp: fix dctcp delayed ACK schedule
tcp: helpers to send special DCTCP ack
tcp: do not cancel delay-AcK on DCTCP special ACK
tcp: do not delay ACK in DCTCP upon CE status change
Greg KH
maintainerMakefile +2 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 116 +SUBLEVEL = 117 EXTRAVERSION = NAME = Diseased Newt
@@ -613,6 +613,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation) KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context) +KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias) KBUILD_CFLAGS += $(call cc-option,-fno-PIE) KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
arch/arc/include/asm/page.h +1 -1
@@ -97,7 +97,7 @@ typedef unsigned long pgtable_t;#define virt_addr_valid (kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)/* Default Permissions for stack/heaps pages (Non Executable) */ -#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE) +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)#define WANT_PAGE_VIRTUAL 1
arch/arc/include/asm/pgtable.h +1 -1
@@ -372,7 +372,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,/* Decode a PTE containing swap "identifier "into constituents */ #define __swp_type (pte_lookalike) (((pte_lookalike).val) & 0x1f) -#define __swp_offset (pte_lookalike) ((pte_lookalike).val << 13) +#define __swp_offset (pte_lookalike) ((pte_lookalike).val >> 13)/* NOPs, to keep generic kernel happy */ #define __pte_to_swp_entry (pte) ((swp_entry_t) { pte_val(pte) })
arch/arm/include/asm/uaccess.h +1 -1
@@ -220,7 +220,7 @@ extern int __put_user_8(void *, unsigned long long); ({ \ unsigned long __limit = current_thread_info()->addr_limit - 1; \ const typeof(*(p)) __user *__tmp_p = (p); \ - register const typeof(*(p)) __r2 asm("r2") = (x); \ + register typeof(*(p)) __r2 asm("r2") = (x); \ register const typeof(*(p)) __user *__p asm("r0") = __tmp_p; \ register unsigned long __l asm("r1") = __limit; \ register int __e asm("r0"); \
arch/x86/kernel/cpu/mcheck/mce.c +0 -3
@@ -2240,9 +2240,6 @@ static ssize_t store_int_with_restart(struct device *s,if (check_interval == old_check_interval)return ret; -if (check_interval <1 ) - check_interval =1 ; -mutex_lock (&mce_sysfs_mutex);mce_restart ();mutex_unlock (&mce_sysfs_mutex);
drivers/net/can/xilinx_can.c +72 -26
227 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +1 -1
@@ -2709,7 +2709,7 @@ int mlx4_RST2INIT_QP_wrapper(struct mlx4_dev *dev, int slave,u32 srqn =qp_get_srqn (qpc) &0xffffff ;int use_srq = (qp_get_srqn (qpc) >>24 ) &1 ;struct res_srq *srq; -int local_qpn =be32_to_cpu (qpc->local_qpn) &0xffffff ; +int local_qpn = vhcr->in_modifier &0xffffff ; err =qp_res_start_move_to (dev, slave, qpn,RES_QP_HW , &qp,0 );if (err)
drivers/ptp/ptp_chardev.c +1 -0
@@ -88,6 +88,7 @@ int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin,case PTP_PF_PHYSYNC :if (chan !=0 )return -EINVAL ; +break ;default :return -EINVAL ; }
drivers/usb/class/cdc-acm.c +3 -0
@@ -1785,6 +1785,9 @@ static const struct usb_device_id acm_ids[] = { { USB_DEVICE(0x09d8, 0x0320), /* Elatec GmbH TWN3 */ .driver_info =NO_UNION_NORMAL ,/* has misplaced union descriptor */ }, + { USB_DEVICE(0x0ca6, 0xa050), /* Castles VEGA3000 */ + .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ + }, { USB_DEVICE(0x2912, 0x0001), /* ATOL FPrint */ .driver_info = CLEAR_HALT_CONDITIONS,
drivers/usb/core/hub.c +6 -2
@@ -1151,10 +1151,14 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)if (!udev || udev->state ==USB_STATE_NOTATTACHED ) {/* Tell hub_wq to disconnect the device or -* check for a new connection +* check for a new connection or over current condition. +* Based on USB2.0 Spec Section 11.12.5, +* C_PORT_OVER_CURRENT could be set while +* PORT_OVER_CURRENT is not. So check for any of them. */ if (udev || (portstatus &USB_PORT_STAT_CONNECTION ) || - (portstatus &USB_PORT_STAT_OVERCURRENT )) + (portstatus &USB_PORT_STAT_OVERCURRENT ) || + (portchange &USB_PORT_STAT_C_OVERCURRENT ))set_bit (port1, hub->change_bits); }else if (portstatus &USB_PORT_STAT_ENABLE ) {
drivers/usb/gadget/function/f_fs.c +1 -1
@@ -2987,7 +2987,7 @@ static int ffs_func_setup(struct usb_function *f,__ffs_event_add (ffs,FUNCTIONFS_SETUP );spin_unlock_irqrestore (&ffs->ev.waitq.lock, flags); -return USB_GADGET_DELAYED_STATUS ; +return creq->wLength ==0 ?USB_GADGET_DELAYED_STATUS :0 ; }static void ffs_func_suspend (struct usb_function *f)
fs/fat/inode.c +13 -7
@@ -610,13 +610,21 @@ static void fat_set_state(struct super_block *sb,brelse (bh); } +static void fat_reset_iocharset (struct fat_mount_options *opts) +{ +if (opts->iocharset != fat_default_iocharset) { +/* Note: opts->iocharset can be NULL here */ +kfree (opts->iocharset); + opts->iocharset = fat_default_iocharset; + } +} +static void delayed_free (struct rcu_head *p) { struct msdos_sb_info *sbi = container_of(p, struct msdos_sb_info, rcu);unload_nls (sbi->nls_disk);unload_nls (sbi->nls_io); -if (sbi->options.iocharset != fat_default_iocharset) -kfree (sbi->options.iocharset); +fat_reset_iocharset (&sbi->options);kfree (sbi); }
@@ -1031,7 +1039,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, opts->fs_fmask = opts->fs_dmask =current_umask (); opts->allow_utime =-1 ; opts->codepage = fat_default_codepage; - opts->iocharset = fat_default_iocharset; +fat_reset_iocharset (opts);if (is_vfat) { opts->shortname =VFAT_SFN_DISPLAY_WINNT |VFAT_SFN_CREATE_WIN95 ; opts->rodir =0 ;
@@ -1181,8 +1189,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat,/* vfat specific */ case Opt_charset: -if (opts->iocharset != fat_default_iocharset) -kfree (opts->iocharset); +fat_reset_iocharset (opts); iocharset =match_strdup (&args[0 ]);if (!iocharset)return -ENOMEM ;
@@ -1774,8 +1781,7 @@ out_fail:iput (fat_inode);unload_nls (sbi->nls_io);unload_nls (sbi->nls_disk); -if (sbi->options.iocharset != fat_default_iocharset) -kfree (sbi->options.iocharset); +fat_reset_iocharset (&sbi->options); sb->s_fs_info =NULL ;kfree (sbi);return error;
include/linux/skbuff.h +6 -6
@@ -475,6 +475,7 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1,* @hash: the packet hash * @queue_mapping: Queue mapping for multiqueue devices * @xmit_more: More SKBs are pending for this queue +* @pfmemalloc: skbuff was allocated from PFMEMALLOC reserves * @ndisc_nodetype: router type (from link layer) * @ooo_okay: allow the mapping of a socket to a queue to be changed * @l4_hash: indicate hash is a canonical 4-tuple hash over transport
@@ -551,8 +552,8 @@ struct sk_buff { fclone:2, peeked:1, head_frag:1, - xmit_more:1; -/* one bit hole */ + xmit_more:1, + pfmemalloc:1;kmemcheck_bitfield_end (flags1);/* fields enclosed in headers_start/headers_end are copied
@@ -572,19 +573,18 @@ struct sk_buff {__u8 __pkt_type_offset[0 ]; __u8 pkt_type:3; - __u8 pfmemalloc:1; __u8 ignore_df:1; __u8 nfctinfo:3; - __u8 nf_trace:1; + __u8 ip_summed:2; __u8 ooo_okay:1; __u8 l4_hash:1; __u8 sw_hash:1; __u8 wifi_acked_valid:1; __u8 wifi_acked:1; - __u8 no_fcs:1; +/* Indicates the inner headers are valid in the skbuff. */ __u8 encapsulation:1; __u8 encap_hdr_csum:1;
@@ -592,11 +592,11 @@ struct sk_buff { __u8 csum_complete_sw:1; __u8 csum_level:2; __u8 csum_bad:1; -#ifdef CONFIG_IPV6_NDISC_NODETYPE __u8 ndisc_nodetype:2;#endif __u8 ipvs_property:1; + __u8 inner_protocol_type:1;/* 4 or 6 bit hole */
include/net/tcp.h +2 -0
@@ -372,6 +372,7 @@ ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags); +void tcp_enter_quickack_mode (struct sock *sk);static inline void tcp_dec_quickack_mode (struct sock *sk,const unsigned int pkts) {
@@ -530,6 +531,7 @@ int tcp_send_synack(struct sock *);bool tcp_syn_flood_action (struct sock *sk,const struct sk_buff *skb,const char *proto);void tcp_push_one (struct sock *,unsigned int mss_now); +void __tcp_send_ack (struct sock *sk,u32 rcv_nxt);void tcp_send_ack (struct sock *sk);void tcp_send_delayed_ack (struct sock *sk);void tcp_send_loss_probe (struct sock *sk);
net/core/rtnetlink.c +6 -3
@@ -1842,9 +1842,12 @@ int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm)return err; } - dev->rtnl_link_state =RTNL_LINK_INITIALIZED ; - -__dev_notify_flags (dev, old_flags, ~0U ); +if (dev->rtnl_link_state ==RTNL_LINK_INITIALIZED ) { +__dev_notify_flags (dev, old_flags,0U ); + }else { + dev->rtnl_link_state =RTNL_LINK_INITIALIZED ; +__dev_notify_flags (dev, old_flags, ~0U ); + }return 0 ; }EXPORT_SYMBOL (rtnl_configure_link);
net/core/skbuff.c +1 -0
@@ -780,6 +780,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb) n->cloned =1 ; n->nohdr =0 ; n->peeked =0 ; +C (pfmemalloc); n->destructor =NULL ;C (tail);C (end);
net/ipv4/ip_output.c +2 -0
@@ -459,6 +459,8 @@ static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from) to->dev = from->dev; to->mark = from->mark; +skb_copy_hash (to, from); +/* Copy the flags to each fragment. */ IPCB (to)->flags =IPCB (from)->flags;
net/ipv4/sysctl_net_ipv4.c +3 -2
@@ -134,8 +134,9 @@ static int ipv4_ping_group_range(struct ctl_table *table, int write,if (write && ret ==0 ) { low =make_kgid (user_ns, urange[0 ]); high =make_kgid (user_ns, urange[1 ]); -if (!gid_valid (low) || !gid_valid (high) || - (urange[1 ] < urange[0 ]) ||gid_lt (high, low)) { +if (!gid_valid (low) || !gid_valid (high)) +return -EINVAL ; +if (urange[1 ] < urange[0 ] ||gid_lt (high, low)) { low =make_kgid (&init_user_ns,1 ); high =make_kgid (&init_user_ns,0 ); }
net/ipv4/tcp_dctcp.c +16 -34
62 lines not on this page · raw message
net/ipv4/tcp_input.c +19 -3
@@ -182,13 +182,14 @@ static void tcp_incr_quickack(struct sock *sk) icsk->icsk_ack.quick =min (quickacks,TCP_MAX_QUICKACKS ); } -static void tcp_enter_quickack_mode (struct sock *sk) +void tcp_enter_quickack_mode (struct sock *sk) {struct inet_connection_sock *icsk =inet_csk (sk);tcp_incr_quickack (sk); icsk->icsk_ack.pingpong =0 ; icsk->icsk_ack.ato =TCP_ATO_MIN ; } +EXPORT_SYMBOL (tcp_enter_quickack_mode);/* Send ACKs quickly, if "quick" count is not exhausted * and the session is not interactive.
@@ -4651,6 +4652,7 @@ restart:static void tcp_collapse_ofo_queue (struct sock *sk) {struct tcp_sock *tp =tcp_sk (sk); +u32 range_truesize, sum_tiny =0 ;struct sk_buff *skb =skb_peek (&tp->out_of_order_queue);struct sk_buff *head;u32 start, end;
@@ -4660,6 +4662,7 @@ static void tcp_collapse_ofo_queue(struct sock *sk) start =TCP_SKB_CB (skb)->seq; end =TCP_SKB_CB (skb)->end_seq; + range_truesize = skb->truesize; head = skb;for (;;) {
@@ -4674,14 +4677,24 @@ static void tcp_collapse_ofo_queue(struct sock *sk)if (!skb ||after (TCP_SKB_CB (skb)->seq, end) ||before (TCP_SKB_CB (skb)->end_seq, start)) { -tcp_collapse (sk, &tp->out_of_order_queue, - head, skb, start, end); +/* Do not attempt collapsing tiny skbs */ +if (range_truesize != head->truesize || + end - start >=SKB_WITH_OVERHEAD (SK_MEM_QUANTUM )) { +tcp_collapse (sk, &tp->out_of_order_queue, + head, skb, start, end); + }else { + sum_tiny += range_truesize; +if (sum_tiny > sk->sk_rcvbuf >>3 ) +return ; + } + head = skb;if (!skb)break ;/* Start new segment */ start =TCP_SKB_CB (skb)->seq; end =TCP_SKB_CB (skb)->end_seq; + range_truesize = skb->truesize; }else {if (before (TCP_SKB_CB (skb)->seq, start)) start =TCP_SKB_CB (skb)->seq;
@@ -4737,6 +4750,9 @@ static int tcp_prune_queue(struct sock *sk)else if (sk_under_memory_pressure (sk)) tp->rcv_ssthresh =min (tp->rcv_ssthresh,4U * tp->advmss); +if (atomic_read (&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) +return 0 ; +tcp_collapse_ofo_queue (sk);if (!skb_queue_empty (&sk->sk_receive_queue)) tcp_collapse(sk, &sk->sk_receive_queue,
net/ipv4/tcp_output.c +25 -8
@@ -183,8 +183,13 @@ static void tcp_event_data_sent(struct tcp_sock *tp, }/* Account for an ACK we sent. */ -static inline void tcp_event_ack_sent (struct sock *sk,unsigned int pkts) +static inline void tcp_event_ack_sent (struct sock *sk,unsigned int pkts, +u32 rcv_nxt) { +struct tcp_sock *tp =tcp_sk (sk); + +if (unlikely (rcv_nxt != tp->rcv_nxt)) +return ;/* Special ACK sent by DCTCP to reflect ECN */ tcp_dec_quickack_mode (sk, pkts);inet_csk_clear_xmit_timer (sk,ICSK_TIME_DACK ); }
@@ -884,8 +889,8 @@ out:* We are working here with either a clone of the original * SKB, or a fresh unique copy made by the retransmit engine. */ -static int tcp_transmit_skb (struct sock *sk,struct sk_buff *skb,int clone_it, -gfp_t gfp_mask) +static int __tcp_transmit_skb (struct sock *sk,struct sk_buff *skb, +int clone_it,gfp_t gfp_mask,u32 rcv_nxt) {const struct inet_connection_sock *icsk =inet_csk (sk);struct inet_sock *inet;
@@ -948,7 +953,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, th->source = inet->inet_sport; th->dest = inet->inet_dport; th->seq =htonl (tcb->seq); - th->ack_seq =htonl (tp->rcv_nxt); + th->ack_seq =htonl (rcv_nxt); *(((__be16 *)th) +6 ) =htons (((tcp_header_size >>2 ) <<12 ) | tcb->tcp_flags);
@@ -990,7 +995,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, icsk->icsk_af_ops->send_check (sk, skb);if (likely (tcb->tcp_flags &TCPHDR_ACK )) -tcp_event_ack_sent (sk,tcp_skb_pcount (skb)); +tcp_event_ack_sent (sk,tcp_skb_pcount (skb), rcv_nxt);if (skb->len != tcp_header_size)tcp_event_data_sent (tp, sk);
@@ -1019,6 +1024,13 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,return net_xmit_eval (err); } +static int tcp_transmit_skb (struct sock *sk,struct sk_buff *skb,int clone_it, +gfp_t gfp_mask) +{ +return __tcp_transmit_skb (sk, skb, clone_it, gfp_mask, +tcp_sk (sk)->rcv_nxt); +} +/* This routine just queues the buffer for sending. * * NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames,
@@ -3220,7 +3232,7 @@ void tcp_send_delayed_ack(struct sock *sk) }/* This routine sends an ack and also updates the window. */ -void tcp_send_ack (struct sock *sk) +void __tcp_send_ack (struct sock *sk,u32 rcv_nxt) {struct sk_buff *buff;
@@ -3249,9 +3261,14 @@ void tcp_send_ack(struct sock *sk)/* Send it off, this clears delayed acks for us. */ skb_mstamp_get (&buff->skb_mstamp); -tcp_transmit_skb (sk, buff,0 ,sk_gfp_atomic (sk,GFP_ATOMIC )); +__tcp_transmit_skb (sk, buff,0 ,sk_gfp_atomic (sk,GFP_ATOMIC ), rcv_nxt); +} +EXPORT_SYMBOL_GPL (__tcp_send_ack); + +void tcp_send_ack (struct sock *sk) +{ +__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); } -EXPORT_SYMBOL_GPL (tcp_send_ack);/* This routine sends a packet with an out of date sequence * number. It assumes the other end will try to ack it.
net/ipv6/ip6_output.c +2 -0
@@ -533,6 +533,8 @@ static void ip6_copy_metadata(struct sk_buff *to, struct sk_buff *from) to->dev = from->dev; to->mark = from->mark; +skb_copy_hash (to, from); +#ifdef CONFIG_NET_SCHED to->tc_index = from->tc_index;#endif
sound/core/rawmidi.c +14 -6
@@ -645,7 +645,7 @@ static int snd_rawmidi_info_select_user(struct snd_card *card,int snd_rawmidi_output_params (struct snd_rawmidi_substream *substream,struct snd_rawmidi_params * params) { -char *newbuf; +char *newbuf, *oldbuf;struct snd_rawmidi_runtime *runtime = substream->runtime;if (substream->append && substream->use_count >1 )
@@ -658,13 +658,17 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,return -EINVAL ; }if (params->buffer_size != runtime->buffer_size) { - newbuf =krealloc (runtime->buffer, params->buffer_size, -GFP_KERNEL ); + newbuf =kmalloc (params->buffer_size,GFP_KERNEL );if (!newbuf)return -ENOMEM ; +spin_lock_irq (&runtime->lock); + oldbuf = runtime->buffer; runtime->buffer = newbuf; runtime->buffer_size = params->buffer_size; runtime->avail = runtime->buffer_size; + runtime->appl_ptr = runtime->hw_ptr =0 ; +spin_unlock_irq (&runtime->lock); +kfree (oldbuf); } runtime->avail_min = params->avail_min; substream->active_sensing = !params->no_active_sensing;
@@ -675,7 +679,7 @@ EXPORT_SYMBOL(snd_rawmidi_output_params);int snd_rawmidi_input_params (struct snd_rawmidi_substream *substream,struct snd_rawmidi_params * params) { -char *newbuf; +char *newbuf, *oldbuf;struct snd_rawmidi_runtime *runtime = substream->runtime;snd_rawmidi_drain_input (substream);
@@ -686,12 +690,16 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,return -EINVAL ; }if (params->buffer_size != runtime->buffer_size) { - newbuf =krealloc (runtime->buffer, params->buffer_size, -GFP_KERNEL ); + newbuf =kmalloc (params->buffer_size,GFP_KERNEL );if (!newbuf)return -ENOMEM ; +spin_lock_irq (&runtime->lock); + oldbuf = runtime->buffer; runtime->buffer = newbuf; runtime->buffer_size = params->buffer_size; + runtime->appl_ptr = runtime->hw_ptr =0 ; +spin_unlock_irq (&runtime->lock); +kfree (oldbuf); } runtime->avail_min = params->avail_min;return 0 ;