snd_cs46xx_proc_init() stores the chip in the private data of the five
region entries, but snd_cs46xx_io_read() reads that back as the region,
so a read of /proc/asound/cardN/CS46xx_BA0 and friends copies from
whatever sits at the region's offset in struct snd_cs46xx instead of
the mapped registers. Store the region.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: [email protected]
Signed-off-by: Christian Brauner (Amutable) <[email protected]>
---
 sound/pci/cs46xx/cs46xx_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 797a5f09cade..efc7df444cb5 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -2764,7 +2764,7 @@ static int snd_cs46xx_proc_init(struct snd_card *card, 
struct snd_cs46xx *chip)
                struct snd_cs46xx_region *region = &chip->region.idx[idx];
                if (! snd_card_proc_new(card, region->name, &entry)) {
                        entry->content = SNDRV_INFO_CONTENT_DATA;
-                       entry->private_data = chip;
+                       entry->private_data = region;
                        entry->c.ops = &snd_cs46xx_proc_io_ops;
                        entry->size = region->size;
                        entry->mode = S_IFREG | 0400;

-- 
2.53.0

Reply via email to