Linux 3.18.128
Greg KH
maintainerI'm announcing the release of the 3.18.128 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 | 2 arch/arm64/Makefile | 2 arch/powerpc/mm/numa.c | 2 drivers/cpufreq/imx6q-cpufreq.c | 7 drivers/gpu/drm/ast/ast_drv.c | 21 drivers/gpu/drm/ast/ast_mode.c | 3 drivers/input/gameport/gameport.c | 4 drivers/input/joystick/xpad.c | 1422 ++++++++++++++++++++++++++++---------- drivers/input/misc/ims-pcu.c | 4 drivers/input/serio/serio.c | 4 drivers/input/serio/serio_raw.c | 4 drivers/net/can/dev.c | 48 - drivers/net/wireless/cw1200/wsm.c | 16 drivers/scsi/qla2xxx/qla_os.c | 5 drivers/scsi/ufs/ufs.h | 3 drivers/scsi/ufs/ufshcd.c | 72 + drivers/tty/n_tty.c | 19 drivers/tty/tty_buffer.c | 2 drivers/usb/core/hub.c | 4 fs/9p/vfs_dir.c | 11 fs/bfs/inode.c | 9 fs/gfs2/ops_fstype.c | 2 include/linux/can/dev.h | 1 kernel/debug/kdb/kdb_io.c | 15 kernel/debug/kdb/kdb_private.h | 2 kernel/debug/kdb/kdb_support.c | 10 mm/shmem.c | 4 net/llc/af_llc.c | 11 net/sctp/associola.c | 10 net/sunrpc/auth_generic.c | 8 net/unix/af_unix.c | 27 31 files changed, 1289 insertions(+), 465 deletions(-)
Andrew Price (1):
gfs2: Don't leave s_fs_info pointing to freed memory in init_sbd
Aniroop Mathur (1):
Input: initialize device counter variables with -1
Anson Huang (1):
cpufreq: imx6q: add return value check for voltage scale
Arnd Bergmann (1):
Input: xpad - remove unused function
Arvind Yadav (1):
Input: xpad - constify usb_device_id
Benjamin Valentin (5):
Input: xpad - sort supported devices by USB ID
Input: xpad - sync supported devices with xboxdrv
Input: xpad - add USB IDs for Mad Catz Brawlstick and Razer Sabertooth
Input: xpad - sync supported devices with 360Controller
Input: xpad - sync supported devices with XBCD
Cameron Gutman (12):
Input: xpad - prevent spurious input from wired Xbox 360 controllers
Input: xpad - fix rumble on Xbox One controllers with 2015 firmware
Input: xpad - fix oops when attaching an unknown Xbox One gamepad
Input: xpad - power off wireless 360 controllers on suspend
Input: xpad - add product ID for Xbox One S pad
Input: xpad - fix Xbox One rumble stopping after 2.5 secs
Input: xpad - don't depend on endpoint order
Input: xpad - fix stuck mode button on Xbox One S pad
Input: xpad - restore LED state after device resume
Input: xpad - support some quirky Xbox One pads
Input: xpad - fix PowerA init quirk for some gamepad models
Input: xpad - validate USB endpoint type during probe
Clement Calmels (1):
Input: xpad - remove spurious events of wireless xpad 360 controller
Daniel Tobias (2):
Input: xpad - correctly sort vendor id's
Input: xpad - move reporting xbox one home button to common function
Dario Scarpa (1):
Input: xpad - fix Razer Atrox Arcade Stick button mapping
Dennis Wassenberg (1):
usb: core: Fix hub port connection events lost
Dmitry Torokhov (1):
Input: xpad - use LED API when identifying wireless controllers
Dominique Martinet (1):
v9fs_dir_readdir: fix double-free on p9stat_read error
Enno Boland (1):
Input: xpad - fix GPD Win 2 controller name
Eric Dumazet (1):
llc: do not use sk_eat_skb()
Erik Lundgren (1):
Input: xpad - add Covert Forces edition of the Xbox One controller
Ethan Lee (1):
Input: xpad - add GPD Win 2 Controller USB IDs
Francis Therien (1):
Input: xpad - add PDP device id 0x02a4
Greg Hackmann (1):
arm64: remove no-op -p linker flag
Greg Kroah-Hartman (2):
tty: wipe buffer if not echoing data
Linux 3.18.128
Johannes Thumshirn (1):
cw1200: Don't leak memory if krealloc failes
Leo Sperling (1):
Input: xpad - fix some coding style issues
Linus Torvalds (1):
tty: wipe buffer.
Marc Kleine-Budde (4):
can: dev: can_get_echo_skb(): factor out non sending code to __can_get_echo_skb()
can: dev: __can_get_echo_skb(): replace struct can_frame by canfd_frame to access frame length
can: dev: __can_get_echo_skb(): Don't crash the kernel if can_priv::echo_skb is accessed out of bounds
can: dev: __can_get_echo_skb(): print error message, if trying to echo non existing skb
Marcus Folkesson (1):
Input: xpad - avoid using __set_bit() for capabilities
Mark Furneaux (1):
Input: xpad - add support for PDP Xbox One controllers
Mauricio Faria de Oliveira (1):
scsi: qla2xxx: do not queue commands when unloading
Ming-ting Yao Wei (1):
Input: xpad - add rumble support for Xbox One controller
Pavel Rojtberg (16):
Input: xpad - re-send LED command on present event
Input: xpad - clarify LED enumeration
Input: xpad - use ida() for finding the pad_nr
Input: xpad - remove needless bulk out URB used for LED setup
Input: xpad - factor out URB submission in xpad_play_effect
Input: xpad - x360w: report dpad as buttons and axes
Input: xpad - query wireless controller state at init
Input: xpad - fix clash of presence handling with LED setting
Input: xpad - correctly handle concurrent LED and FF requests
Input: xpad - workaround dead irq_out after suspend/ resume
Input: xpad - correct xbox one pad device name
Input: xpad - move pending clear to the correct location
Input: xpad - add more third-party controllers
Input: xpad - xbox one elite controller support
Input: xpad - use correct product id for x360w controllers
Input: xpad - simplify error condition in init_output
Pierre-Loup A. Griffais (4):
Input: xpad - set the LEDs properly on XBox Wireless controllers
Input: xpad - move the input device creation to a new function
Input: xpad - handle "present" and "gone" correctly
Input: xpad - update Xbox One Force Feedback Support
Prarit Bhargava (1):
kdb: Use strscpy with destination buffer size
Ramses Ramírez (1):
Input: xpad - add support for Xbox1 PDP Camo series gamepad
Satheesh Rajendran (1):
powerpc/numa: Suppress "VPHN is not supported" messages
Silvan Jegen (1):
Input: xpad - add Mad Catz FightStick TE 2 VID/PID
Subhash Jadavani (1):
scsi: ufs: fix race between clock gating and devfreq scaling work
Tetsuo Handa (1):
bfs: add sanity check at bfs_fill_super()
Thomas Zimmermann (1):
drm/ast: Remove existing framebuffers before loading driver
Trond Myklebust (1):
SUNRPC: Fix a bogus get/put in generic_key_to_expire()
Venkat Gopalakrishnan (1):
scsi: ufshcd: Fix race between clk scaling and ungate work
WANG Cong (1):
af_unix: move unix_mknod() out of bindlock
Xin Long (1):
sctp: clear the transport of some out_chunk_list chunks in sctp_assoc_rm_peer
Y.C. Chen (2):
drm/ast: fixed cursor may disappear sometimes drm/ast: change resolution may cause screen blurred
Yaniv Gardi (1):
scsi: ufs: fix bugs related to null pointer access and array size
Yufen Yu (1):
tmpfs: make lseek(SEEK_DATA/SEK_HOLE) return ENXIO with a negative offset
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 127 +SUBLEVEL = 128 EXTRAVERSION = NAME = Diseased Newt
arch/arm64/Makefile +1 -1
@@ -10,7 +10,7 @@ # # Copyright (C) 1995-2001 by Russell King -LDFLAGS_vmlinux :=-p --no-undefined -X +LDFLAGS_vmlinux :=--no-undefined -X CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET) OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S GZFLAGS :=-9
arch/powerpc/mm/numa.c +1 -1
@@ -1479,7 +1479,7 @@ static long vphn_get_associativity(unsigned long cpu,switch (rc) {case H_FUNCTION : -printk (KERN_INFO +printk_once (KERN_INFO "VPHN is not supported. Disabling polling...\n" );stop_topology_update ();break ;
drivers/cpufreq/imx6q-cpufreq.c +6 -1
@@ -105,8 +105,13 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)/* Ensure the arm clock divider is what we expect */ ret =clk_set_rate (arm_clk, new_freq *1000 );if (ret) { +int ret1; +dev_err (cpu_dev,"failed to set clock rate: %d\n" , ret); -regulator_set_voltage_tol (arm_reg, volt_old,0 ); + ret1 =regulator_set_voltage_tol (arm_reg, volt_old,0 ); +if (ret1) +dev_warn (cpu_dev, +"failed to restore vddarm voltage: %d\n" , ret1);return ret; }
drivers/gpu/drm/ast/ast_drv.c +21 -0
@@ -60,8 +60,29 @@ static const struct pci_device_id pciidlist[] = {MODULE_DEVICE_TABLE (pci, pciidlist); +static void ast_kick_out_firmware_fb (struct pci_dev *pdev) +{ +struct apertures_struct *ap; +bool primary = false; + + ap =alloc_apertures (1 ); +if (!ap) +return ; + + ap->ranges[0 ].base =pci_resource_start (pdev,0 ); + ap->ranges[0 ].size =pci_resource_len (pdev,0 ); + +#ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE ].flags &IORESOURCE_ROM_SHADOW ; +#endif +remove_conflicting_framebuffers (ap,"astdrmfb" , primary); +kfree (ap); +} +static int ast_pci_probe (struct pci_dev *pdev,const struct pci_device_id *ent) { +ast_kick_out_firmware_fb (pdev); +return drm_get_pci_dev (pdev, ent, &driver); }
drivers/gpu/drm/ast/ast_mode.c +2 -1
@@ -549,6 +549,7 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc, }ast_bo_unreserve (bo); +ast_set_offset_reg (crtc);ast_set_start_address_crt1 (crtc, (u32 )gpu_addr);return 0 ;
@@ -1246,7 +1247,7 @@ static int ast_cursor_move(struct drm_crtc *crtc,ast_set_index_reg (ast,AST_IO_CRTC_PORT ,0xc7 , ((y >>8 ) &0x07 ));/* dummy write to fire HWC */ -ast_set_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xCB ,0xFF ,0x00 ); +ast_show_cursor (crtc);return 0 ; }
drivers/input/gameport/gameport.c +2 -2
@@ -527,14 +527,14 @@ EXPORT_SYMBOL(gameport_set_phys);*/ static void gameport_init_port (struct gameport *gameport) { -static atomic_t gameport_no =ATOMIC_INIT (0 ); +static atomic_t gameport_no =ATOMIC_INIT (-1 );__module_get (THIS_MODULE );mutex_init (&gameport->drv_mutex);device_initialize (&gameport->dev);dev_set_name (&gameport->dev,"gameport%lu" , - (unsigned long )atomic_inc_return (&gameport_no) -1 ); + (unsigned long )atomic_inc_return (&gameport_no)); gameport->dev.bus = &gameport_bus; gameport->dev.release = gameport_release_port;if (gameport->parent)
drivers/input/joystick/xpad.c +1058 -364
1,923 lines not on this page · raw message
drivers/input/misc/ims-pcu.c +2 -2
@@ -1871,7 +1871,7 @@ static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id)static int ims_pcu_init_application_mode (struct ims_pcu *pcu) { -static atomic_t device_no =ATOMIC_INIT (0 ); +static atomic_t device_no =ATOMIC_INIT (-1 );const struct ims_pcu_device_info *info;int error;
@@ -1902,7 +1902,7 @@ static int ims_pcu_init_application_mode(struct ims_pcu *pcu) }/* Device appears to be operable, complete initialization */ - pcu->device_no =atomic_inc_return (&device_no) -1 ; + pcu->device_no =atomic_inc_return (&device_no);/* * PCU-B devices, both GEN_1 and GEN_2 do not have OFN sensor
drivers/input/serio/serio.c +2 -2
@@ -514,7 +514,7 @@ static void serio_release_port(struct device *dev)*/ static void serio_init_port (struct serio *serio) { -static atomic_t serio_no =ATOMIC_INIT (0 ); +static atomic_t serio_no =ATOMIC_INIT (-1 );__module_get (THIS_MODULE );
@@ -525,7 +525,7 @@ static void serio_init_port(struct serio *serio)mutex_init (&serio->drv_mutex);device_initialize (&serio->dev);dev_set_name (&serio->dev,"serio%lu" , - (unsigned long )atomic_inc_return (&serio_no) -1 ); + (unsigned long )atomic_inc_return (&serio_no)); serio->dev.bus = &serio_bus; serio->dev.release = serio_release_port; serio->dev.groups = serio_device_attr_groups;
drivers/input/serio/serio_raw.c +2 -2
@@ -292,7 +292,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,static int serio_raw_connect (struct serio *serio,struct serio_driver *drv) { -static atomic_t serio_raw_no =ATOMIC_INIT (0 ); +static atomic_t serio_raw_no =ATOMIC_INIT (-1 );struct serio_raw *serio_raw;int err;
@@ -303,7 +303,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv) }snprintf (serio_raw->name,sizeof (serio_raw->name), -"serio_raw%ld" , (long )atomic_inc_return (&serio_raw_no) -1 ); +"serio_raw%ld" , (long )atomic_inc_return (&serio_raw_no));kref_init (&serio_raw->kref);INIT_LIST_HEAD (&serio_raw->client_list);init_waitqueue_head (&serio_raw->wait);
drivers/net/can/dev.c +35 -13
63 lines not on this page · raw message
drivers/net/wireless/cw1200/wsm.c +9 -7
@@ -1807,16 +1807,18 @@ static int wsm_buf_reserve(struct wsm_buf *buf, size_t extra_size) {size_t pos = buf->data - buf->begin;size_t size = pos + extra_size; +u8 *tmp; size =round_up (size,FWLOAD_BLOCK_SIZE ); - buf->begin =krealloc (buf->begin, size,GFP_KERNEL |GFP_DMA ); -if (buf->begin) { - buf->data = &buf->begin[pos]; - buf->end = &buf->begin[size]; -return 0 ; - }else { - buf->end = buf->data = buf->begin; + tmp =krealloc (buf->begin, size,GFP_KERNEL |GFP_DMA ); +if (!tmp) { +wsm_buf_deinit (buf);return -ENOMEM ; } + + buf->begin = tmp; + buf->data = &buf->begin[pos]; + buf->end = &buf->begin[size]; +return 0 ; }
drivers/scsi/qla2xxx/qla_os.c +5 -0
@@ -687,6 +687,11 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)srb_t *sp;int rval; +if (unlikely (test_bit (UNLOADING , &base_vha->dpc_flags))) { + cmd->result =DID_NO_CONNECT <<16 ; + goto qc24_fail_command; + } +if (ha->flags.eeh_busy) {if (ha->flags.pci_channel_io_perm_failure) { ql_dbg(ql_dbg_aer, vha, 0x9010,
drivers/scsi/ufs/ufs.h +2 -1
@@ -45,6 +45,7 @@#define QUERY_DESC_MIN_SIZE 2#define QUERY_OSF_SIZE (GENERAL_UPIU_REQUEST_SIZE - \ (sizeof(struct utp_upiu_header))) +#define RESPONSE_UPIU_SENSE_DATA_LENGTH 18#define UPIU_HEADER_DWORD (byte3, byte2, byte1, byte0)\ cpu_to_be32((byte3 << 24) | (byte2 << 16) |\
@@ -383,7 +384,7 @@ struct utp_cmd_rsp {__be32 residual_transfer_count;__be32 reserved[4 ];__be16 sense_data_len; -u8 sense_data[18 ]; +u8 sense_data[RESPONSE_UPIU_SENSE_DATA_LENGTH ]; };/**
drivers/scsi/ufs/ufshcd.c +66 -6
121 lines not on this page · raw message
drivers/tty/n_tty.c +17 -2
@@ -188,15 +188,29 @@ static int receive_room(struct tty_struct *tty)return left; } +/* If we are not echoing the data, perhaps this is a secret so erase it */ +static inline void zero_buffer (struct tty_struct *tty,u8 *buffer,int size) +{ +bool icanon = !!L_ICANON (tty); +bool no_echo = !L_ECHO (tty); + +if (icanon && no_echo) +memset (buffer,0x00 , size); +} +static inline int tty_copy_to_user (struct tty_struct *tty,void __user *to, -const void *from, +void *from,unsigned long n) {struct n_tty_data *ldata = tty->disc_data; +int retval;tty_audit_add_data (tty, from, n, ldata->icanon); -return copy_to_user (to, from, n); + retval =copy_to_user (to, from, n); +if (!retval) +zero_buffer (tty, from, n); +return retval; }/**
@@ -2006,6 +2020,7 @@ static int copy_from_read_buf(struct tty_struct *tty, is_eof = n ==1 &&read_buf (ldata, tail) ==EOF_CHAR (tty);tty_audit_add_data (tty,read_buf_addr (ldata, tail), n, ldata->icanon); +zero_buffer (tty,read_buf_addr (ldata, tail), n); ldata->read_tail += n;/* Turn single EOF into zero-length read */ if (L_EXTPROC (tty) && ldata->icanon && is_eof && !read_cnt (ldata))
drivers/tty/tty_buffer.c +2 -0
@@ -415,6 +415,8 @@ receive_buf(struct tty_struct *tty, struct tty_buffer *head, int count) disc->ops->receive_buf (tty, p, f, count); } head->read += count; +if (count >0 ) +memset (p,0 , count);return count; }
drivers/usb/core/hub.c +3 -1
@@ -2765,7 +2765,9 @@ static int hub_port_reset(struct usb_hub *hub, int port1, USB_PORT_FEAT_C_BH_PORT_RESET);usb_clear_port_feature (hub->hdev, port1,USB_PORT_FEAT_C_PORT_LINK_STATE ); -usb_clear_port_feature (hub->hdev, port1, + +if (udev) +usb_clear_port_feature (hub->hdev, port1,USB_PORT_FEAT_C_CONNECTION );/*
fs/9p/vfs_dir.c +0 -11
@@ -75,15 +75,6 @@ static inline int dt_type(struct p9_wstat *mistat)return rettype; } -static void p9stat_init (struct p9_wstat *stbuf) -{ - stbuf->name =NULL ; - stbuf->uid =NULL ; - stbuf->gid =NULL ; - stbuf->muid =NULL ; - stbuf->extension =NULL ; -} -/** * v9fs_alloc_rdir_buf - Allocate buffer used for read and readdir * @filp: opened file structure
@@ -136,12 +127,10 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx) rdir->tail = err; }while (rdir->head < rdir->tail) { -p9stat_init (&st); err =p9stat_read (fid->clnt, rdir->buf + rdir->head, rdir->tail - rdir->head, &st);if (err) {p9_debug (P9_DEBUG_VFS ,"returned %d\n" , err); -p9stat_free (&st);return -EIO ; } reclen = st.size+2 ;
fs/bfs/inode.c +6 -3
@@ -349,7 +349,8 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent) s->s_magic =BFS_MAGIC ; -if (le32_to_cpu (bfs_sb->s_start) >le32_to_cpu (bfs_sb->s_end)) { +if (le32_to_cpu (bfs_sb->s_start) >le32_to_cpu (bfs_sb->s_end) || +le32_to_cpu (bfs_sb->s_start) <BFS_BSIZE ) {printf ("Superblock is corrupted\n" ); goto out1; }
@@ -358,9 +359,11 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)sizeof (struct bfs_inode ) +BFS_ROOT_INO -1 ; imap_len = (info->si_lasti /8 ) +1 ; - info->si_imap =kzalloc (imap_len,GFP_KERNEL ); -if (!info->si_imap) + info->si_imap =kzalloc (imap_len,GFP_KERNEL | __GFP_NOWARN); +if (!info->si_imap) { +printf ("Cannot allocate %u bytes\n" , imap_len); goto out1; + }for (i =0 ; i <BFS_ROOT_INO ; i++)set_bit (i, info->si_imap);
fs/gfs2/ops_fstype.c +1 -1
@@ -71,13 +71,13 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)if (!sdp)return NULL ; - sb->s_fs_info = sdp; sdp->sd_vfs = sb; sdp->sd_lkstats = alloc_percpu(struct gfs2_pcpu_lkstats);if (!sdp->sd_lkstats) {kfree (sdp);return NULL ; } + sb->s_fs_info = sdp;set_bit (SDF_NOJOURNALID , &sdp->sd_flags);gfs2_tune_init (&sdp->sd_tune);
include/linux/can/dev.h +1 -0
@@ -148,6 +148,7 @@ void can_bus_off(struct net_device *dev);void can_put_echo_skb (struct sk_buff *skb,struct net_device *dev,unsigned int idx); +struct sk_buff *__can_get_echo_skb (struct net_device *dev,unsigned int idx,u8 *len_ptr);unsigned int can_get_echo_skb (struct net_device *dev,unsigned int idx);void can_free_echo_skb (struct net_device *dev,unsigned int idx);
kernel/debug/kdb/kdb_io.c +9 -6
@@ -215,7 +215,7 @@ static char *kdb_read(char *buffer, size_t bufsize)int count;int i;int diag, dtab_count; -int key; +int key, buf_size, ret; diag =kdbgetintenv ("DTABCOUNT" , &dtab_count);
@@ -335,9 +335,8 @@ poll_again:else p_tmp = tmpbuffer; len =strlen (p_tmp); - count =kallsyms_symbol_complete (p_tmp, -sizeof (tmpbuffer) - - (p_tmp - tmpbuffer)); + buf_size =sizeof (tmpbuffer) - (p_tmp - tmpbuffer); + count =kallsyms_symbol_complete (p_tmp, buf_size);if (tab ==2 && count >0 ) {kdb_printf ("\n%d symbols are found." , count);if (count > dtab_count) {
@@ -349,9 +348,13 @@ poll_again: }kdb_printf ("\n" );for (i =0 ; i < count; i++) { -if (WARN_ON (!kallsyms_symbol_next (p_tmp, i))) + ret =kallsyms_symbol_next (p_tmp, i, buf_size); +if (WARN_ON (!ret))break ; -kdb_printf ("%s " , p_tmp); +if (ret != -E2BIG ) +kdb_printf ("%s " , p_tmp); +else +kdb_printf ("%s... " , p_tmp); *(p_tmp + len) ='\0' ; }if (i >= dtab_count)
kernel/debug/kdb/kdb_private.h +1 -1
@@ -83,7 +83,7 @@ typedef struct __ksymtab {unsigned long sym_start;unsigned long sym_end; } kdb_symtab_t; -extern int kallsyms_symbol_next (char *prefix_name,int flag); +extern int kallsyms_symbol_next (char *prefix_name,int flag,int buf_size);extern int kallsyms_symbol_complete (char *prefix_name,int max_len);/* Exported Symbols for kernel loadable modules to use. */
kernel/debug/kdb/kdb_support.c +5 -5
@@ -221,11 +221,13 @@ int kallsyms_symbol_complete(char *prefix_name, int max_len)* Parameters: * prefix_name prefix of a symbol name to lookup * flag 0 means search from the head, 1 means continue search. +* buf_size maximum length that can be written to prefix_name +* buffer * Returns: * 1 if a symbol matches the given prefix. * 0 if no string found */ -int kallsyms_symbol_next (char *prefix_name,int flag) +int kallsyms_symbol_next (char *prefix_name,int flag,int buf_size) {int prefix_len =strlen (prefix_name);static loff_t pos;
@@ -235,10 +237,8 @@ int kallsyms_symbol_next(char *prefix_name, int flag) pos =0 ;while ((name =kdb_walk_kallsyms (&pos))) { -if (strncmp (name, prefix_name, prefix_len) ==0 ) { -strncpy (prefix_name, name,strlen (name)+1 ); -return 1 ; - } +if (!strncmp (name, prefix_name, prefix_len)) +return strscpy (prefix_name, name, buf_size); }return 0 ; }
mm/shmem.c +1 -3
@@ -1805,9 +1805,7 @@ static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence)mutex_lock (&inode->i_mutex);/* We're holding i_mutex so we can access i_size directly */ -if (offset <0 ) - offset = -EINVAL ; -else if (offset >= inode->i_size) +if (offset <0 || offset >= inode->i_size) offset = -ENXIO ;else { start = offset >>PAGE_CACHE_SHIFT ;
net/llc/af_llc.c +4 -7
@@ -726,7 +726,6 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,struct sk_buff *skb =NULL ;struct sock *sk = sock->sk;struct llc_sock *llc =llc_sk (sk); -unsigned long cpu_flags;size_t copied =0 ;u32 peek_seq =0 ;u32 *seq, skb_len;
@@ -852,9 +851,8 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock, goto copy_uaddr;if (!(flags &MSG_PEEK )) { -spin_lock_irqsave (&sk->sk_receive_queue.lock, cpu_flags); -sk_eat_skb (sk, skb); -spin_unlock_irqrestore (&sk->sk_receive_queue.lock, cpu_flags); +skb_unlink (skb, &sk->sk_receive_queue); +kfree_skb (skb); *seq =0 ; }
@@ -875,9 +873,8 @@ copy_uaddr:llc_cmsg_rcv (msg, skb);if (!(flags &MSG_PEEK )) { -spin_lock_irqsave (&sk->sk_receive_queue.lock, cpu_flags); -sk_eat_skb (sk, skb); -spin_unlock_irqrestore (&sk->sk_receive_queue.lock, cpu_flags); +skb_unlink (skb, &sk->sk_receive_queue); +kfree_skb (skb); *seq =0 ; }
net/sctp/associola.c +7 -3
@@ -487,8 +487,9 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,void sctp_assoc_rm_peer (struct sctp_association *asoc,struct sctp_transport *peer) { -struct list_head *pos; -struct sctp_transport *transport; +struct sctp_transport *transport; +struct list_head *pos; +struct sctp_chunk *ch;pr_debug ("%s: association:%p addr:%pISpc\n" , __func__, asoc, &peer->ipaddr.sa);
@@ -544,7 +545,6 @@ void sctp_assoc_rm_peer(struct sctp_association *asoc,*/ if (!list_empty (&peer->transmitted)) {struct sctp_transport *active = asoc->peer.active_path; -struct sctp_chunk *ch;/* Reset the transport of each chunk on this list */ list_for_each_entry(ch, &peer->transmitted,
@@ -566,6 +566,10 @@ void sctp_assoc_rm_peer(struct sctp_association *asoc,sctp_transport_hold (active); } +list_for_each_entry (ch, &asoc->outqueue.out_chunk_list, list) +if (ch->transport == peer) + ch->transport =NULL ; + asoc->peer.transport_count--;sctp_transport_free (peer);
net/sunrpc/auth_generic.c +1 -7
@@ -272,13 +272,7 @@ static bool generic_key_to_expire(struct rpc_cred *cred) { struct auth_cred *acred = &container_of(cred, struct generic_cred, gc_base)->acred; -bool ret; - -get_rpccred (cred); - ret =test_bit (RPC_CRED_KEY_EXPIRE_SOON , &acred->ac_flags); -put_rpccred (cred); - -return ret; +return test_bit (RPC_CRED_KEY_EXPIRE_SOON , &acred->ac_flags); }static const struct rpc_credops generic_credops = {
net/unix/af_unix.c +16 -11
@@ -980,6 +980,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)unsigned int hash;struct unix_address *addr;struct hlist_head *list; +struct path path = {NULL ,NULL }; err = -EINVAL ;if (sunaddr->sun_family !=AF_UNIX )
@@ -995,9 +996,20 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) goto out; addr_len = err; +if (sun_path[0 ]) { +umode_t mode =S_IFSOCK | + (SOCK_INODE (sock)->i_mode & ~current_umask ()); + err =unix_mknod (sun_path, mode, &path); +if (err) { +if (err == -EEXIST ) + err = -EADDRINUSE ; + goto out; + } + } + err =mutex_lock_interruptible (&u->readlock);if (err) - goto out; + goto out_put; err = -EINVAL ;if (u->addr)
@@ -1014,16 +1026,6 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)atomic_set (&addr->refcnt,1 );if (sun_path[0 ]) { -struct path path; -umode_t mode =S_IFSOCK | - (SOCK_INODE (sock)->i_mode & ~current_umask ()); - err =unix_mknod (sun_path, mode, &path); -if (err) { -if (err == -EEXIST ) - err = -EADDRINUSE ; -unix_release_addr (addr); - goto out_up; - } addr->hash =UNIX_HASH_SIZE ; hash =d_backing_inode (path.dentry)->i_ino & (UNIX_HASH_SIZE -1 );spin_lock (&unix_table_lock);
@@ -1050,6 +1052,9 @@ out_unlock:spin_unlock (&unix_table_lock); out_up:mutex_unlock (&u->readlock); +out_put: +if (err) +path_put (&path); out:return err; }