1. 08 Jan, 2016 1 commit
    • Linus Torvalds's avatar
      Merge tag 'sound-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 4054f64c
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A slightly higher volume than a new year's wish, but not too
        worrisome: a large LOC is only for HD-audio device-specific quirks, so
        fairly safe to apply.  The rest ASoC fixes are all trivial and small;
        a simple replacement of mutex call with nested lock version, a few
        Arizona and Realtek codec fixes, and a regression fix for Skylake
        firmware handling"
      
      * tag 'sound-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ASoC: Intel: Skylake: Fix the memory leak
        ASoC: Intel: Skylake: Revert previous broken fix memory leak fix
        ASoC: Use nested lock for snd_soc_dapm_mutex_lock
        ASoC: rt5645: add sys clk detection
        ALSA: hda - Add keycode map for alc input device
        ALSA: hda - Add mic mute hotkey quirk for Lenovo ThinkCentre AIO
        ASoC: arizona: Fix bclk for sample rates that are multiple of 4kHz
      4054f64c
  2. 07 Jan, 2016 8 commits
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 02006f7a
      Linus Torvalds authored
      Pull drm nouveau fix from Dave Airlie:
       "Still not back to work, but I decided to forward this fix"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/nouveau/gr/nv40: fix oops in interrupt handler
      02006f7a
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v4.4-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 1d8b0e79
      Linus Torvalds authored
      Pull IOMMU fixes from Joerg Roedel:
      
       - Two build issues, one in the ipmmu-vmsa driver and one for the new
         generic dma-api implemention used on arm64
      
       - A performance fix for said dma-api implemention
      
       - An issue caused by a wrong offset in map_sg in the same code as above
      
      * tag 'iommu-fixes-v4.4-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/dma: Use correct offset in map_sg
        iommu/ipmmu-vmsa: Don't truncate ttbr if LPAE is not enabled
        iommu/dma: Avoid unlikely high-order allocations
        iommu/dma: Add some missing #includes
      1d8b0e79
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.4-rc4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 2626820d
      Linus Torvalds authored
      Pull ftrace fix from Steven Rostedt:
       "PeiyangX Qiu reported that if a module fails to load between calling
        ftrace_module_init() and do_init_module() that the allocations made in
        ftrace_module_init() will not be freed, resulting in a memory leak.
      
        The solution is to call ftrace_release_mod() on the failing module in
        the fail path befor do_init_module() is called.  This will remove any
        allocations made for that module, and nothing if ftrace_module_init()
        wasn't called yet for that module.
      
        Note, once do_init_module() is called, the MODULE_GOING notifiers are
        called for the failed module, which calls into the ftrace code to do
        the proper clean up (basically calling ftrace_release_mod())"
      
      * tag 'trace-v4.4-rc4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace/module: Call clean up function when module init fails early
      2626820d
    • Steven Rostedt (Red Hat)'s avatar
      ftrace/module: Call clean up function when module init fails early · 049fb9bd
      Steven Rostedt (Red Hat) authored
      If the module init code fails after calling ftrace_module_init() and before
      calling do_init_module(), we can suffer from a memory leak. This is because
      ftrace_module_init() allocates pages to store the locations that ftrace
      hooks are placed in the module text. If do_init_module() fails, it still
      calls the MODULE_GOING notifiers which will tell ftrace to do a clean up of
      the pages it allocated for the module. But if load_module() fails before
      then, the pages allocated by ftrace_module_init() will never be freed.
      
      Call ftrace_release_mod() on the module if load_module() fails before
      getting to do_init_module().
      
      Link: http://lkml.kernel.org/r/567CEA31.1070507@intel.comReported-by: default avatar"Qiu, PeiyangX" <peiyangx.qiu@intel.com>
      Fixes: a949ae56 "ftrace/module: Hardcode ftrace_module_init() call into load_module()"
      Cc: stable@vger.kernel.org # v2.6.38+
      Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      049fb9bd
    • Robin Murphy's avatar
      iommu/dma: Use correct offset in map_sg · 164afb1d
      Robin Murphy authored
      When mapping a non-page-aligned scatterlist entry, we copy the original
      offset to the output DMA address before aligning it to hand off to
      iommu_map_sg(), then later adding the IOVA page address portion to get
      the final mapped address. However, when the IOVA page size is smaller
      than the CPU page size, it is the offset within the IOVA page we want,
      not that within the CPU page, which can easily be larger than an IOVA
      page and thus result in an incorrect final address.
      
      Fix the bug by taking only the IOVA-aligned part of the offset as the
      basis of the DMA address, not the whole thing.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      164afb1d
    • Dave Airlie's avatar
      Merge branch 'linux-4.4' of git://github.com/skeggsb/linux into drm-fixes · 3bea6a4c
      Dave Airlie authored
      single nv40 oops fix.
      
      * 'linux-4.4' of git://github.com/skeggsb/linux:
        drm/nouveau/gr/nv40: fix oops in interrupt handler
      3bea6a4c
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20160106' of git://git.infradead.org/linux-mtd · b06f3a16
      Linus Torvalds authored
      Pull MTD fixes from Brian Norris:
       "Three last MTD fixes for v4.4.  These are all fixes for regressions
        and bugs reported mid cycle.  Unfortunately, some of them took a bit
        long to get proper testing and feedback.
      
         - Assign the default MTD name earlier in the registration process, so
           partition parsers (like cmdlinepart) see the right name.  Without
           this, some systems may come up with unpartitioned flash.  This was
           a v4.4-rc1 regression.
      
         - Revert some new Winbond SPI NOR flash unlocking/locking support;
           new code in v4.4 caused regressions on some Spansion flash.
      
         - Fix mis-typed parameter ordering in SPI NOR unlock function; this
           bug was introduced in v4.4-rc1"
      
      * tag 'for-linus-20160106' of git://git.infradead.org/linux-mtd:
        mtd: spi-nor: fix stm_is_locked_sr() parameters
        mtd: spi-nor: fix Spansion regressions (aliased with Winbond)
        mtd: fix cmdlinepart parser, early naming for auto-filled MTD
      b06f3a16
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 51cb67c0
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "As usual, there are a couple straggler bug fixes:
      
         1) qlcnic_alloc_mbx_args() error returns are not checked in qlcnic
            driver.  Fix from Insu Yun.
      
         2) SKB refcounting bug in connector, from Florian Westphal.
      
         3) vrf_get_saddr() has to propagate fib_lookup() errors to it's
            callers, from David Ahern.
      
         4) Fix AF_UNIX splice/bind deadlock, from Rainer Weikusat.
      
         5) qdisc_rcu_free() fails to free the per-cpu qstats.  Fix from John
            Fastabend.
      
         6) vmxnet3 driver passes wrong page to dma_map_page(), fix from
           Shrikrishna Khare.
      
         7) Don't allow zero cwnd in tcp_cwnd_reduction(), from Yuchung Cheng"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        tcp: fix zero cwnd in tcp_cwnd_reduction
        Driver: Vmxnet3: Fix regression caused by 5738a09d
        net: qmi_wwan: Add WeTelecom-WPD600N
        mkiss: fix scribble on freed memory
        net: possible use after free in dst_release
        net: sched: fix missing free per cpu on qstats
        ARM: net: bpf: fix zero right shift
        6pack: fix free memory scribbles
        net: filter: make JITs zero A for SKF_AD_ALU_XOR_X
        bridge: Only call /sbin/bridge-stp for the initial network namespace
        af_unix: Fix splice-bind deadlock
        net: Propagate lookup failure in l3mdev_get_saddr to caller
        r8152: add reset_resume function
        connector: bump skb->users before callback invocation
        cxgb4: correctly handling failed allocation
        qlcnic: correctly handle qlcnic_alloc_mbx_args
      51cb67c0
  3. 06 Jan, 2016 12 commits
  4. 05 Jan, 2016 14 commits
    • Mark Brown's avatar
    • Mark Brown's avatar
    • Mark Brown's avatar
    • Mark Brown's avatar
    • Hannes Frederic Sowa's avatar
      bridge: Only call /sbin/bridge-stp for the initial network namespace · ff621985
      Hannes Frederic Sowa authored
      [I stole this patch from Eric Biederman. He wrote:]
      
      > There is no defined mechanism to pass network namespace information
      > into /sbin/bridge-stp therefore don't even try to invoke it except
      > for bridge devices in the initial network namespace.
      >
      > It is possible for unprivileged users to cause /sbin/bridge-stp to be
      > invoked for any network device name which if /sbin/bridge-stp does not
      > guard against unreasonable arguments or being invoked twice on the
      > same network device could cause problems.
      
      [Hannes: changed patch using netns_eq]
      
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ff621985
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.4-rc4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · ee9a7d2c
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Two more fixes:
      
        1. The recordmcount change had an output that used sprintf()
           (incorrectly) when it should have been a fprintf() to stderr.
      
        2. The printk_formats file could crash if someone added a
           trace_printk() in the core kernel, and also added one in a module.
           This does not affect production kernels.  Only kernels where
           developers add trace_printk() for debugging can crash"
      
      * tag 'trace-v4.4-rc4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Fix setting of start_index in find_next()
        ftrace/scripts: Fix incorrect use of sprintf in recordmcount
      ee9a7d2c
    • Linus Torvalds's avatar
      Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · 3331f99a
      Linus Torvalds authored
      Pull tile bugfix from Chris Metcalf:
       "This fixes a bug that Sudip's buildbot found for tilepro allmodconfig.
      
        I've tagged it for stable only back to 3.19, which was when most of
        the other affected architectures added their support for working
        around this issue"
      
      * 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        tile: provide CONFIG_PAGE_SIZE_64KB etc for tilepro
      3331f99a
    • Chris Metcalf's avatar
      tile: provide CONFIG_PAGE_SIZE_64KB etc for tilepro · c1b27ab5
      Chris Metcalf authored
      This allows the build system to know that it can't attempt to
      configure the Lustre virtual block device, for example, when tilepro
      is using 64KB pages (as it does by default).  The tilegx build
      already provided those symbols.
      
      Previously we required that the tilepro hypervisor be rebuilt with
      a different hardcoded page size in its headers, and then Linux be
      rebuilt using the updated hypervisor header.  Now we allow each of
      the hypervisor and Linux to be built independently.  We still check
      at boot time to ensure that the page size provided by the hypervisor
      matches what Linux expects.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@ezchip.com>
      Cc: stable@vger.kernel.org [3.19+]
      c1b27ab5
    • Vinod Koul's avatar
      ASoC: Intel: Skylake: Fix the memory leak · d8018361
      Vinod Koul authored
      This provide the fix for firmware memory by freeing the pointer in driver
      remove where it is safe to do so
      Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      d8018361
    • Vinod Koul's avatar
      ASoC: Intel: Skylake: Revert previous broken fix memory leak fix · fb203adc
      Vinod Koul authored
      This reverts commit 87b5ed8e ("ASoC: Intel:
      Skylake: fix memory leak") as it causes regression on Skylake devices
      
      The SKL drivers can be deferred probe. The topology file based widgets can
      have references to topology file so this can't be freed until card is fully
      created, so revert this patch for now
      
      [   66.682767] BUG: unable to handle kernel paging request at ffffc900001363fc
      [   66.690735] IP: [<ffffffff806c94dd>] strnlen+0xd/0x40
      [   66.696509] PGD 16e035067 PUD 16e036067 PMD 16e038067 PTE 0
      [   66.702925] Oops: 0000 [#1] PREEMPT SMP
      [   66.768390] CPU: 3 PID: 57 Comm: kworker/u16:3 Tainted: G O 4.4.0-rc7-skl #62
      [   66.778869] Hardware name: Intel Corporation Skylake Client platform
      [   66.793201] Workqueue: deferwq deferred_probe_work_func
      [   66.799173] task: ffff88008b700f40 ti: ffff88008b704000 task.ti: ffff88008b704000
      [   66.807692] RIP: 0010:[<ffffffff806c94dd>]  [<ffffffff806c94dd>] strnlen+0xd/0x40
      [   66.816243] RSP: 0018:ffff88008b707878  EFLAGS: 00010286
      [   66.822293] RAX: ffffffff80e60a82 RBX: 000000000000000e RCX: fffffffffffffffe
      [   66.830406] RDX: ffffc900001363fc RSI: ffffffffffffffff RDI: ffffc900001363fc
      [   66.838520] RBP: ffff88008b707878 R08: 000000000000ffff R09: 000000000000ffff
      [   66.846649] R10: 0000000000000001 R11: ffffffffa01c6368 R12: ffffc900001363fc
      [   66.854765] R13: 0000000000000000 R14: 00000000ffffffff R15: 0000000000000000
      [   66.862910] FS:  0000000000000000(0000) GS:ffff88016ecc0000(0000) knlGS:0000000000000000
      [   66.872150] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   66.878696] CR2: ffffc900001363fc CR3: 0000000002c09000 CR4: 00000000003406e0
      [   66.886820] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   66.894938] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [   66.903052] Stack:
      [   66.905346]  ffff88008b7078b0 ffffffff806cb1db 000000000000000e 0000000000000000
      [   66.913854]  ffff88008b707928 ffffffffa00d1050 ffffffffa00d104e ffff88008b707918
      [   66.922353]  ffffffff806ccbd6 ffff88008b707948 0000000000000046 ffff88008b707940
      [   66.930855] Call Trace:
      [   66.933646]  [<ffffffff806cb1db>] string.isra.4+0x3b/0xd0
      [   66.939793]  [<ffffffff806ccbd6>] vsnprintf+0x116/0x540
      [   66.945742]  [<ffffffff806d02f0>] kvasprintf+0x40/0x80
      [   66.951591]  [<ffffffff806d0370>] kasprintf+0x40/0x50
      [   66.957359]  [<ffffffffa00c085f>] dapm_create_or_share_kcontrol+0x1cf/0x300 [snd_soc_core]
      [   66.966771]  [<ffffffff8057dd1e>] ? __kmalloc+0x16e/0x2a0
      [   66.972931]  [<ffffffffa00c0dab>] snd_soc_dapm_new_widgets+0x41b/0x4b0 [snd_soc_core]
      [   66.981857]  [<ffffffffa00be8c0>] ? snd_soc_dapm_add_routes+0xb0/0xd0 [snd_soc_core]
      [   67.007828]  [<ffffffffa00b92ed>] soc_probe_component+0x23d/0x360 [snd_soc_core]
      [   67.016244]  [<ffffffff80b14e69>] ? mutex_unlock+0x9/0x10
      [   67.022405]  [<ffffffffa00ba02f>] snd_soc_instantiate_card+0x47f/0xd10 [snd_soc_core]
      [   67.031329]  [<ffffffff8049eeb2>] ? debug_mutex_init+0x32/0x40
      [   67.037973]  [<ffffffffa00baa92>] snd_soc_register_card+0x1d2/0x2b0 [snd_soc_core]
      [   67.046619]  [<ffffffffa00c8b54>] devm_snd_soc_register_card+0x44/0x80 [snd_soc_core]
      [   67.055539]  [<ffffffffa01c303b>] skylake_audio_probe+0x1b/0x20 [snd_soc_skl_rt286]
      [   67.064292]  [<ffffffff808aa887>] platform_drv_probe+0x37/0x90
      Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      fb203adc
    • Rainer Weikusat's avatar
      af_unix: Fix splice-bind deadlock · c845acb3
      Rainer Weikusat authored
      On 2015/11/06, Dmitry Vyukov reported a deadlock involving the splice
      system call and AF_UNIX sockets,
      
      http://lists.openwall.net/netdev/2015/11/06/24
      
      The situation was analyzed as
      
      (a while ago) A: socketpair()
      B: splice() from a pipe to /mnt/regular_file
      	does sb_start_write() on /mnt
      C: try to freeze /mnt
      	wait for B to finish with /mnt
      A: bind() try to bind our socket to /mnt/new_socket_name
      	lock our socket, see it not bound yet
      	decide that it needs to create something in /mnt
      	try to do sb_start_write() on /mnt, block (it's
      	waiting for C).
      D: splice() from the same pipe to our socket
      	lock the pipe, see that socket is connected
      	try to lock the socket, block waiting for A
      B:	get around to actually feeding a chunk from
      	pipe to file, try to lock the pipe.  Deadlock.
      
      on 2015/11/10 by Al Viro,
      
      http://lists.openwall.net/netdev/2015/11/10/4
      
      The patch fixes this by removing the kern_path_create related code from
      unix_mknod and executing it as part of unix_bind prior acquiring the
      readlock of the socket in question. This means that A (as used above)
      will sb_start_write on /mnt before it acquires the readlock, hence, it
      won't indirectly block B which first did a sb_start_write and then
      waited for a thread trying to acquire the readlock. Consequently, A
      being blocked by C waiting for B won't cause a deadlock anymore
      (effectively, both A and B acquire two locks in opposite order in the
      situation described above).
      
      Dmitry Vyukov(<dvyukov@google.com>) tested the original patch.
      Signed-off-by: default avatarRainer Weikusat <rweikusat@mobileactivedefense.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c845acb3
    • David Ahern's avatar
      net: Propagate lookup failure in l3mdev_get_saddr to caller · b5bdacf3
      David Ahern authored
      Commands run in a vrf context are not failing as expected on a route lookup:
          root@kenny:~# ip ro ls table vrf-red
          unreachable default
      
          root@kenny:~# ping -I vrf-red -c1 -w1 10.100.1.254
          ping: Warning: source address might be selected on device other than vrf-red.
          PING 10.100.1.254 (10.100.1.254) from 0.0.0.0 vrf-red: 56(84) bytes of data.
      
          --- 10.100.1.254 ping statistics ---
          2 packets transmitted, 0 received, 100% packet loss, time 999ms
      
      Since the vrf table does not have a route for 10.100.1.254 the ping
      should have failed. The saddr lookup causes a full VRF table lookup.
      Propogating a lookup failure to the user allows the command to fail as
      expected:
      
          root@kenny:~# ping -I vrf-red -c1 -w1 10.100.1.254
          connect: No route to host
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5bdacf3
    • hayeswang's avatar
      r8152: add reset_resume function · 7ec2541a
      hayeswang authored
      When the reset_resume() is called, the flag of SELECTIVE_SUSPEND should be
      cleared and reinitialize the device, whether the SELECTIVE_SUSPEND is set
      or not. If reset_resume() is called, it means the power supply is cut or the
      device is reset. That is, the device wouldn't be in runtime suspend state and
      the reinitialization is necessary.
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7ec2541a
    • Florian Westphal's avatar
      connector: bump skb->users before callback invocation · 55285bf0
      Florian Westphal authored
      Dmitry reports memleak with syskaller program.
      Problem is that connector bumps skb usecount but might not invoke callback.
      
      So move skb_get to where we invoke the callback.
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      55285bf0
  5. 04 Jan, 2016 5 commits
    • Insu Yun's avatar
      cxgb4: correctly handling failed allocation · 3934aa4c
      Insu Yun authored
      Since t4_alloc_mem can be failed in memory pressure,
      if not properly handled, NULL dereference could be happened.
      Signed-off-by: default avatarInsu Yun <wuninsu@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3934aa4c
    • Insu Yun's avatar
      qlcnic: correctly handle qlcnic_alloc_mbx_args · b77357b6
      Insu Yun authored
      Since qlcnic_alloc_mbx_args can be failed,
      return value should be checked.
      Signed-off-by: default avatarInsu Yun <wuninsu@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b77357b6
    • Ben Skeggs's avatar
      drm/nouveau/gr/nv40: fix oops in interrupt handler · 9daf38f4
      Ben Skeggs authored
      fdo#93557
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      Cc: stable@vger.kernel.org
      9daf38f4
    • Qiu Peiyang's avatar
      tracing: Fix setting of start_index in find_next() · f36d1be2
      Qiu Peiyang authored
      When we do cat /sys/kernel/debug/tracing/printk_formats, we hit kernel
      panic at t_show.
      
      general protection fault: 0000 [#1] PREEMPT SMP
      CPU: 0 PID: 2957 Comm: sh Tainted: G W  O 3.14.55-x86_64-01062-gd4acdc7 #2
      RIP: 0010:[<ffffffff811375b2>]
       [<ffffffff811375b2>] t_show+0x22/0xe0
      RSP: 0000:ffff88002b4ebe80  EFLAGS: 00010246
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000004
      RDX: 0000000000000004 RSI: ffffffff81fd26a6 RDI: ffff880032f9f7b1
      RBP: ffff88002b4ebe98 R08: 0000000000001000 R09: 000000000000ffec
      R10: 0000000000000000 R11: 000000000000000f R12: ffff880004d9b6c0
      R13: 7365725f6d706400 R14: ffff880004d9b6c0 R15: ffffffff82020570
      FS:  0000000000000000(0000) GS:ffff88003aa00000(0063) knlGS:00000000f776bc40
      CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
      CR2: 00000000f6c02ff0 CR3: 000000002c2b3000 CR4: 00000000001007f0
      Call Trace:
       [<ffffffff811dc076>] seq_read+0x2f6/0x3e0
       [<ffffffff811b749b>] vfs_read+0x9b/0x160
       [<ffffffff811b7f69>] SyS_read+0x49/0xb0
       [<ffffffff81a3a4b9>] ia32_do_call+0x13/0x13
       ---[ end trace 5bd9eb630614861e ]---
      Kernel panic - not syncing: Fatal exception
      
      When the first time find_next calls find_next_mod_format, it should
      iterate the trace_bprintk_fmt_list to find the first print format of
      the module. However in current code, start_index is smaller than *pos
      at first, and code will not iterate the list. Latter container_of will
      get the wrong address with former v, which will cause mod_fmt be a
      meaningless object and so is the returned mod_fmt->fmt.
      
      This patch will fix it by correcting the start_index. After fixed,
      when the first time calls find_next_mod_format, start_index will be
      equal to *pos, and code will iterate the trace_bprintk_fmt_list to
      get the right module printk format, so is the returned mod_fmt->fmt.
      
      Link: http://lkml.kernel.org/r/5684B900.9000309@intel.com
      
      Cc: stable@vger.kernel.org # 3.12+
      Fixes: 102c9323 "tracing: Add __tracepoint_string() to export string pointers"
      Signed-off-by: default avatarQiu Peiyang <peiyangx.qiu@intel.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      f36d1be2
    • Brian Norris's avatar
      mtd: fix cmdlinepart parser, early naming for auto-filled MTD · 472b444e
      Brian Norris authored
      Commit 807f16d4 ("mtd: core: set some defaults when dev.parent is
      set") attempted to provide some default settings for MTDs that
       (a) assign the parent device and
       (b) don't provide their own name or owner
      
      However, this isn't a perfect drop-in replacement for the boilerplate
      found in some drivers, because the MTD name is used by partition
      parsers like cmdlinepart, but the name isn't set until add_mtd_device(),
      after the parsing is completed. This means cmdlinepart sees a NULL name
      and therefore will not work properly.
      
      Fix this by moving the default name and owner assignment to be first in
      the MTD registration process.
      
      [Note: this does not fix all reported issues, particularly with NAND
      drivers. Will require an additional fix for drivers/mtd/nand/]
      
      Fixes: 807f16d4 ("mtd: core: set some defaults when dev.parent is set")
      Reported-by: default avatarHeiko Schocher <hs@denx.de>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      Cc: Heiko Schocher <hs@denx.de>
      Cc: Frans Klaver <fransklaver@gmail.com>
      472b444e