aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-ntrig.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-ntrig.c')
-rw-r--r--drivers/hid/hid-ntrig.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
index ef95102515e4..600f2075512f 100644
--- a/drivers/hid/hid-ntrig.c
+++ b/drivers/hid/hid-ntrig.c
@@ -115,7 +115,8 @@ static inline int ntrig_get_mode(struct hid_device *hdev)
115 struct hid_report *report = hdev->report_enum[HID_FEATURE_REPORT]. 115 struct hid_report *report = hdev->report_enum[HID_FEATURE_REPORT].
116 report_id_hash[0x0d]; 116 report_id_hash[0x0d];
117 117
118 if (!report) 118 if (!report || report->maxfield < 1 ||
119 report->field[0]->report_count < 1)
119 return -EINVAL; 120 return -EINVAL;
120 121
121 hid_hw_request(hdev, report, HID_REQ_GET_REPORT); 122 hid_hw_request(hdev, report, HID_REQ_GET_REPORT);
@@ -237,7 +238,7 @@ static ssize_t set_min_width(struct device *dev,
237 238
238 unsigned long val; 239 unsigned long val;
239 240
240 if (strict_strtoul(buf, 0, &val)) 241 if (kstrtoul(buf, 0, &val))
241 return -EINVAL; 242 return -EINVAL;
242 243
243 if (val > nd->sensor_physical_width) 244 if (val > nd->sensor_physical_width)
@@ -272,7 +273,7 @@ static ssize_t set_min_height(struct device *dev,
272 273
273 unsigned long val; 274 unsigned long val;
274 275
275 if (strict_strtoul(buf, 0, &val)) 276 if (kstrtoul(buf, 0, &val))
276 return -EINVAL; 277 return -EINVAL;
277 278
278 if (val > nd->sensor_physical_height) 279 if (val > nd->sensor_physical_height)
@@ -306,7 +307,7 @@ static ssize_t set_activate_slack(struct device *dev,
306 307
307 unsigned long val; 308 unsigned long val;
308 309
309 if (strict_strtoul(buf, 0, &val)) 310 if (kstrtoul(buf, 0, &val))
310 return -EINVAL; 311 return -EINVAL;
311 312
312 if (val > 0x7f) 313 if (val > 0x7f)
@@ -341,7 +342,7 @@ static ssize_t set_activation_width(struct device *dev,
341 342
342 unsigned long val; 343 unsigned long val;
343 344
344 if (strict_strtoul(buf, 0, &val)) 345 if (kstrtoul(buf, 0, &val))
345 return -EINVAL; 346 return -EINVAL;
346 347
347 if (val > nd->sensor_physical_width) 348 if (val > nd->sensor_physical_width)
@@ -377,7 +378,7 @@ static ssize_t set_activation_height(struct device *dev,
377 378
378 unsigned long val; 379 unsigned long val;
379 380
380 if (strict_strtoul(buf, 0, &val)) 381 if (kstrtoul(buf, 0, &val))
381 return -EINVAL; 382 return -EINVAL;
382 383
383 if (val > nd->sensor_physical_height) 384 if (val > nd->sensor_physical_height)
@@ -411,7 +412,7 @@ static ssize_t set_deactivate_slack(struct device *dev,
411 412
412 unsigned long val; 413 unsigned long val;
413 414
414 if (strict_strtoul(buf, 0, &val)) 415 if (kstrtoul(buf, 0, &val))
415 return -EINVAL; 416 return -EINVAL;
416 417
417 /* 418 /*