Fix/sof coccinelle#453
Merged
plbossart merged 2 commits intothesofproject:topic/sof-devfrom Dec 17, 2018
Merged
Conversation
Detected with Coccinelle sound/soc/sof/nocodec.c:46:2-7: WARNING: invalid free of devm_ allocated data Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Detected with Coccinelle sound/soc/sof/debug.c:19:11-28: WARNING opportunity for simple_open, see also structure on line 82 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
keyonjie
reviewed
Dec 17, 2018
| ret = sof_bes_setup(dev, ops, links, ops->num_drv, | ||
| &sof_nocodec_card); | ||
| if (ret) { | ||
| kfree(links); |
There was a problem hiding this comment.
I believe Coccinelle will not complain if we change it to 'devm_kfree(dev, links);'
But I like reporting error and stopping probing, leave the devm free to the device freeing itself.
cujomalainey
pushed a commit
to cujomalainey/linux
that referenced
this pull request
Jan 30, 2019
commit 5547932 upstream. If blkdev_get fails, we shouldn't do blkdev_put. Otherwise, kernel emits below log. This patch fixes it. WARNING: CPU: 0 PID: 1893 at fs/block_dev.c:1828 blkdev_put+0x105/0x120 Modules linked in: CPU: 0 PID: 1893 Comm: swapoff Not tainted 4.19.0+ thesofproject#453 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 RIP: 0010:blkdev_put+0x105/0x120 Call Trace: __x64_sys_swapoff+0x46d/0x490 do_syscall_64+0x5a/0x190 entry_SYSCALL_64_after_hwframe+0x49/0xbe irq event stamp: 4466 hardirqs last enabled at (4465): __free_pages_ok+0x1e3/0x490 hardirqs last disabled at (4466): trace_hardirqs_off_thunk+0x1a/0x1c softirqs last enabled at (3420): __do_softirq+0x333/0x446 softirqs last disabled at (3407): irq_exit+0xd1/0xe0 Link: http://lkml.kernel.org/r/20181127055429.251614-3-minchan@kernel.org Signed-off-by: Minchan Kim <minchan@kernel.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Reviewed-by: Joey Pabalinas <joeypabalinas@gmail.com> Cc: <stable@vger.kernel.org> [4.14+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2 issues found in 30mn, let's make it a default tool for SOF...