1
0
Fork 0
Commit Graph

18 Commits (761cab513d5e9079ec8ace48ab05d84b0083653b)

Author SHA1 Message Date
Christophe JAILLET 70cf59b8ff staging: mt7621-dma: Fix a resource leak in an error handling path
commit d887d6104a upstream.

If an error occurs after calling 'mtk_hsdma_init()', it must be undone by
a corresponding call to 'mtk_hsdma_uninit()' as already done in the
remove function.

Fixes: 0853c7a53e ("staging: mt7621-dma: ralink: add rt2880 dma engine")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201213153513.138723-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-12 20:16:18 +01:00
Stephen Boyd 04d15d5cad staging: Remove dev_err() usage after platform_get_irq()
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-43-swboyd@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 20:50:04 +02:00
Benjamin Sherman 4c1d2fc7d5 staging: mt7621-dma: sizeof via pointer dereference
Pass the size of a struct into kzalloc by pointer dereference.  This
complies with the Linux kernel coding style and removes the possibility
for a bug if the pointer's type is changed.

Signed-off-by: Benjamin Sherman <benjamin@bensherman.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30 17:22:47 -07:00
Puranjay Mohan e23fa431e7 Staging: mt7621-dma: Remove braces around single if statement
Fix following checkpatch.pl warning by removing unnecessary braces:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-20 10:57:19 +02:00
Nishka Dasgupta b5243475c1 staging: mt7621-dma: Remove print statement on devm_kzalloc error
Remove print statement following error of devm_kzalloc. Issue found with
Coccinelle.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03 11:08:00 +02:00
Armando Miraglia d5cac52c09 staging: mediatek: addres minor style issues flagged by clang-format.
Running clang-format on mtk-hsdma.c I noticed that few lines would not
need to be wrapped, since they fit 80 columns. This change changes such
lines to better fit the style-guide.

Signed-off-by: Armando Miraglia <armax@google.com>
Acked-by: Sean Wang <sean.wang@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-29 17:28:47 +01:00
Jules Irenge 1f08c4a54b staging: mt7621-dma: remove license boilerplate text
Remove license boilerplate text.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-03 09:25:42 +01:00
Jules Irenge 80afa56547 staging: mt7621-dma: add SPDX GPL-2.0+ license identifier
Add SPDX GPL-2.0+ license to fix missing SPDX warning
 reported by checkpatch.pl.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-03 09:25:42 +01:00
Bhanusree Pola d8d2785be2 Staging: mt761-dma: Alignment should match open parenthesis
Adjust "dev_dbg" parameters to match alignment with open parenthesis
Issue found with checkpatch.pl

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26 11:40:07 +01:00
Bhanusree Pola c4d8416c85 Staging: mt7621_dma: Prefer unsigned int over just unsigned
Replace 'unsigned' with 'unsigned int' to be specific with data type.
Issue found with checkpatch.pl

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26 11:40:07 +01:00
Greg Kroah-Hartman d5d12ce229 Merge 4.20-rc5 into staging-next
We need the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-03 07:55:28 +01:00
Sergio Paracuellos 354e379684 staging: mt7621-dma: fix potentially dereferencing uninitialized 'tx_desc'
Function 'mtk_hsdma_start_transfer' uses 'tx_desc' pointer which can be
dereferenced before it is initializated. Initializate pointer before
avoiding the problem.

Fixes: 0853c7a53e ("staging: mt7621-dma: ralink: add rt2880 dma engine")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 13:08:28 +01:00
Kimberly Brown c471d7cca8 staging: mt7621-dma: Add braces around else branches
Add braces around else branches in conditional statements that include
branches with multiple statements. This style complies with the Linux
kernel coding style and improves consistency and readability. Issues found by
checkpatch.

Signed-off-by: Kimberly Brown <kimbrownkd@gmail.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05 14:16:33 +01:00
Christian Lütke-Stetzkamp 4554af3492 staging: mt7621-dma: Fixing parenthesis alignment
Fixes checkpatch check: PARENTHESIS_ALIGNMENT

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-23 16:00:18 +01:00
Christian Lütke-Stetzkamp 5e62653b6f staging: mt7621-dma: Removing unnecessary braces
Fixes checkpatch warning: BRACES

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-23 16:00:18 +01:00
Christian Lütke-Stetzkamp f22d82420f staging: mt7621-dma: Fix Spacing
Fixes checkpatch error: SPACING

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-23 16:00:17 +01:00
Christian Lütke-Stetzkamp c91034b21d staging: mt7621-dma: Fix Pointer Location
Fixes checkpatch error: POINTER_LOCATION

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-23 16:00:17 +01:00
John Crispin 0853c7a53e staging: mt7621-dma: ralink: add rt2880 dma engine
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19 19:56:02 +01:00