aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/firmware_class
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/firmware_class')
-rw-r--r--Documentation/firmware_class/firmware_sample_firmware_class.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Documentation/firmware_class/firmware_sample_firmware_class.c b/Documentation/firmware_class/firmware_sample_firmware_class.c
index fba943aacf93..2de62854f0e5 100644
--- a/Documentation/firmware_class/firmware_sample_firmware_class.c
+++ b/Documentation/firmware_class/firmware_sample_firmware_class.c
@@ -109,15 +109,15 @@ static int fw_setup_class_device(struct class_device *class_dev,
109 const char *fw_name, 109 const char *fw_name,
110 struct device *device) 110 struct device *device)
111{ 111{
112 int retval = 0; 112 int retval;
113 struct firmware_priv *fw_priv = kmalloc(sizeof(struct firmware_priv), 113 struct firmware_priv *fw_priv;
114 GFP_KERNEL);
115 114
116 if(!fw_priv){ 115 fw_priv = kzalloc(sizeof(struct firmware_priv), GFP_KERNEL);
116 if (!fw_priv) {
117 retval = -ENOMEM; 117 retval = -ENOMEM;
118 goto out; 118 goto out;
119 } 119 }
120 memset(fw_priv, 0, sizeof(*fw_priv)); 120
121 memset(class_dev, 0, sizeof(*class_dev)); 121 memset(class_dev, 0, sizeof(*class_dev));
122 122
123 strncpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX); 123 strncpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX);