Skip to content

Commit

Permalink
Revert "ASoC: tegra: Stack buffer overflow in pcm"
Browse files Browse the repository at this point in the history
This reverts commit ffb71c4.

Reason for revert: No stack buffer overflow as this function is used
only in audio driver and with known inputs.

Bug 3463493

Change-Id: I262894daa21caf8a1a309a7eb2715a215d9f3b0f
Signed-off-by: Mohan Kumar <[email protected]>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-4.9/+/2656994
Tested-by: mobile promotions <[email protected]>
Reviewed-by: Sharad Gupta <[email protected]>
Reviewed-by: mobile promotions <[email protected]>
GVS: Gerrit_Virtual_Submit
  • Loading branch information
mkumard authored and mobile promotions committed Jan 24, 2022
1 parent 2cfee99 commit 8df0945
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 26 deletions.
6 changes: 3 additions & 3 deletions sound/soc/tegra/tegra30_i2s.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* tegra30_i2s.h - Definitions for Tegra30 I2S driver
*
* Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
Expand Down Expand Up @@ -238,11 +238,11 @@ struct tegra30_i2s {
struct clk *clk_i2s;
enum tegra30_ahub_txcif capture_i2s_cif;
enum tegra30_ahub_rxcif capture_fifo_cif;
char capture_dma_chan[CHAN_NAME_WIDTH];
char capture_dma_chan[8];
struct snd_dmaengine_dai_dma_data capture_dma_data;
enum tegra30_ahub_rxcif playback_i2s_cif;
enum tegra30_ahub_txcif playback_fifo_cif;
char playback_dma_chan[CHAN_NAME_WIDTH];
char playback_dma_chan[8];
struct snd_dmaengine_dai_dma_data playback_dma_data;
struct regmap *regmap;
struct snd_dmaengine_pcm_config dma_config;
Expand Down
23 changes: 3 additions & 20 deletions sound/soc/tegra/tegra_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* tegra_pcm.c - Tegra PCM driver
*
* Author: Stephen Warren <[email protected]>
* Copyright (C) 2010-2021, NVIDIA CORPORATION. All rights reserved.
* Copyright (C) 2010,2012 - NVIDIA, Inc.
*
* Based on code copyright/by:
*
Expand Down Expand Up @@ -58,9 +58,6 @@ static const struct snd_dmaengine_pcm_config tegra_dmaengine_pcm_config = {

int tegra_pcm_platform_register(struct device *dev)
{
if (!dev)
return -ENOMEM;

return snd_dmaengine_pcm_register(dev, &tegra_dmaengine_pcm_config, 0);
}
EXPORT_SYMBOL_GPL(tegra_pcm_platform_register);
Expand All @@ -69,31 +66,17 @@ int tegra_pcm_platform_register_with_chan_names(struct device *dev,
struct snd_dmaengine_pcm_config *config,
char *txdmachan, char *rxdmachan)
{
if (!dev || !config)
return -ENOMEM;

*config = tegra_dmaengine_pcm_config;
config->dma_dev = dev->parent;

if (txdmachan && (strlen(txdmachan) < CHAN_NAME_WIDTH))
config->chan_names[0] = txdmachan;
else
return -ENOMEM;

if (rxdmachan && (strlen(rxdmachan) < CHAN_NAME_WIDTH))
config->chan_names[1] = rxdmachan;
else
return -ENOMEM;
config->chan_names[0] = txdmachan;
config->chan_names[1] = rxdmachan;

return snd_dmaengine_pcm_register(dev, config, 0);
}
EXPORT_SYMBOL_GPL(tegra_pcm_platform_register_with_chan_names);

void tegra_pcm_platform_unregister(struct device *dev)
{
if (!dev)
return;

return snd_dmaengine_pcm_unregister(dev);
}
EXPORT_SYMBOL_GPL(tegra_pcm_platform_unregister);
Expand Down
4 changes: 1 addition & 3 deletions sound/soc/tegra/tegra_pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* tegra_pcm.h - Definitions for Tegra PCM driver
*
* Author: Stephen Warren <[email protected]>
* Copyright (C) 2010-2021, NVIDIA CORPORATION. All rights reserved.
* Copyright (C) 2010,2012 - NVIDIA, Inc.
*
* Based on code copyright/by:
*
Expand Down Expand Up @@ -31,8 +31,6 @@
#ifndef __TEGRA_PCM_H__
#define __TEGRA_PCM_H__

#define CHAN_NAME_WIDTH 8

struct snd_dmaengine_pcm_config;

int tegra_pcm_platform_register(struct device *dev);
Expand Down

0 comments on commit 8df0945

Please sign in to comment.