diff options
author | Jiri Slaby <xslaby@fi.muni.cz> | 2006-01-24 16:15:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-01-26 01:41:32 -0500 |
commit | 805f123d5026ed1e4c01c3ed4f7c23ca663ac727 (patch) | |
tree | 7d9adae1a946bc59763743b61cd63167440ffc77 | |
parent | 65f17ee28ef497f437ee82700dde2908ec7f6271 (diff) |
V4L/DVB (3439a): media video stradis memory fix
memset clears once set structure, there is actually no need for memset,
because configure function do it for us. Next, vfree(NULL) is legal, so
avoid useless labels.
Thanks Dave Jones for reporting this.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/stradis.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c index 54fc33011ffb..9d769264a329 100644 --- a/drivers/media/video/stradis.c +++ b/drivers/media/video/stradis.c | |||
@@ -2012,7 +2012,6 @@ static int __devinit init_saa7146(struct pci_dev *pdev) | |||
2012 | { | 2012 | { |
2013 | struct saa7146 *saa = pci_get_drvdata(pdev); | 2013 | struct saa7146 *saa = pci_get_drvdata(pdev); |
2014 | 2014 | ||
2015 | memset(saa, 0, sizeof(*saa)); | ||
2016 | saa->user = 0; | 2015 | saa->user = 0; |
2017 | /* reset the saa7146 */ | 2016 | /* reset the saa7146 */ |
2018 | saawrite(0xffff0000, SAA7146_MC1); | 2017 | saawrite(0xffff0000, SAA7146_MC1); |
@@ -2062,16 +2061,16 @@ static int __devinit init_saa7146(struct pci_dev *pdev) | |||
2062 | } | 2061 | } |
2063 | if (saa->audbuf == NULL && (saa->audbuf = vmalloc(65536)) == NULL) { | 2062 | if (saa->audbuf == NULL && (saa->audbuf = vmalloc(65536)) == NULL) { |
2064 | dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr); | 2063 | dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr); |
2065 | goto errvid; | 2064 | goto errfree; |
2066 | } | 2065 | } |
2067 | if (saa->osdbuf == NULL && (saa->osdbuf = vmalloc(131072)) == NULL) { | 2066 | if (saa->osdbuf == NULL && (saa->osdbuf = vmalloc(131072)) == NULL) { |
2068 | dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr); | 2067 | dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr); |
2069 | goto erraud; | 2068 | goto errfree; |
2070 | } | 2069 | } |
2071 | /* allocate 81920 byte buffer for clipping */ | 2070 | /* allocate 81920 byte buffer for clipping */ |
2072 | if ((saa->dmavid2 = kzalloc(VIDEO_CLIPMAP_SIZE, GFP_KERNEL)) == NULL) { | 2071 | if ((saa->dmavid2 = kzalloc(VIDEO_CLIPMAP_SIZE, GFP_KERNEL)) == NULL) { |
2073 | dev_err(&pdev->dev, "%d: clip kmalloc failed\n", saa->nr); | 2072 | dev_err(&pdev->dev, "%d: clip kmalloc failed\n", saa->nr); |
2074 | goto errosd; | 2073 | goto errfree; |
2075 | } | 2074 | } |
2076 | /* setup clipping registers */ | 2075 | /* setup clipping registers */ |
2077 | saawrite(virt_to_bus(saa->dmavid2), SAA7146_BASE_EVEN2); | 2076 | saawrite(virt_to_bus(saa->dmavid2), SAA7146_BASE_EVEN2); |
@@ -2085,15 +2084,11 @@ static int __devinit init_saa7146(struct pci_dev *pdev) | |||
2085 | I2CBusScan(saa); | 2084 | I2CBusScan(saa); |
2086 | 2085 | ||
2087 | return 0; | 2086 | return 0; |
2088 | errosd: | 2087 | errfree: |
2089 | vfree(saa->osdbuf); | 2088 | vfree(saa->osdbuf); |
2090 | saa->osdbuf = NULL; | ||
2091 | erraud: | ||
2092 | vfree(saa->audbuf); | 2089 | vfree(saa->audbuf); |
2093 | saa->audbuf = NULL; | ||
2094 | errvid: | ||
2095 | vfree(saa->vidbuf); | 2090 | vfree(saa->vidbuf); |
2096 | saa->vidbuf = NULL; | 2091 | saa->audbuf = saa->osdbuf = saa->vidbuf = NULL; |
2097 | err: | 2092 | err: |
2098 | return -ENOMEM; | 2093 | return -ENOMEM; |
2099 | } | 2094 | } |