summaryrefslogtreecommitdiff
path: root/drivers/staging/dgap
diff options
context:
space:
mode:
authorMark Hounschell <markh@compro.net>2014-04-23 10:33:44 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-16 12:15:18 -0700
commit077c28f8c2f6d375bb7927c1f909df810776647b (patch)
tree1bfb146a86b638af0537ceeacd14924d82a41dc2 /drivers/staging/dgap
parentabeb935f11e1b5c891456e5f567b65422ea87952 (diff)
staging: dgap: Fix how we insure config data is a string
This patch changes the way we insure the config data is a string. Clearly this was just wrong. After a certain number of loads/unloads various OOPs were generated indicating something other than this driver had a problem. It was this driver. Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Reported-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgap')
-rw-r--r--drivers/staging/dgap/dgap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 3c9278a224e2..e0b8d0f051cc 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -834,7 +834,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
return ret;
}
- dgap_config_buf = kmalloc(fw->size + 1, GFP_KERNEL);
+ dgap_config_buf = kzalloc(fw->size + 1, GFP_KERNEL);
if (!dgap_config_buf) {
release_firmware(fw);
return -ENOMEM;
@@ -842,7 +842,6 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
memcpy(dgap_config_buf, fw->data, fw->size);
release_firmware(fw);
- dgap_config_buf[fw->size + 1] = '\0';
if (dgap_parsefile(&dgap_config_buf, TRUE) != 0) {
kfree(dgap_config_buf);