~ubuntu-branches/ubuntu/raring/linux-ti-omap4/raring-proposed

« back to all changes in this revision

Viewing changes to drivers/scsi/scsi_sysfs.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Ubuntu: 3.5.0-25.38
  • Date: 2013-02-20 22:03:31 UTC
  • mfrom: (74.1.1 quantal-proposed)
  • Revision ID: package-import@ubuntu.com-20130220220331-0ea4l33x3cr61nch
Tags: 3.5.0-220.28
* Release Tracking Bug
  - LP: #1130311

[ Paolo Pisati ]

* rebased on Ubuntu-3.5.0-25.38

[ Ubuntu: 3.5.0-25.38 ]

* Release Tracking Bug
  - LP: #1129472
* ptrace: introduce signal_wake_up_state() and ptrace_signal_wake_up()
  - LP: #1119885, #1129192
  - CVE-2013-0871
* ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL
  - LP: #1119885, #1129192
  - CVE-2013-0871
* wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED
  task
  - LP: #1119885, #1129192
  - CVE-2013-0871

Show diffs side-by-side

added added

removed removed

Lines of Context:
246
246
 
247
247
static DEVICE_ATTR(active_mode, S_IRUGO | S_IWUSR, show_shost_active_mode, NULL);
248
248
 
249
 
static int check_reset_type(char *str)
 
249
static int check_reset_type(const char *str)
250
250
{
251
 
        if (strncmp(str, "adapter", 10) == 0)
 
251
        if (sysfs_streq(str, "adapter"))
252
252
                return SCSI_ADAPTER_RESET;
253
 
        else if (strncmp(str, "firmware", 10) == 0)
 
253
        else if (sysfs_streq(str, "firmware"))
254
254
                return SCSI_FIRMWARE_RESET;
255
255
        else
256
256
                return 0;
263
263
        struct Scsi_Host *shost = class_to_shost(dev);
264
264
        struct scsi_host_template *sht = shost->hostt;
265
265
        int ret = -EINVAL;
266
 
        char str[10];
267
266
        int type;
268
267
 
269
 
        sscanf(buf, "%s", str);
270
 
        type = check_reset_type(str);
271
 
 
 
268
        type = check_reset_type(buf);
272
269
        if (!type)
273
270
                goto exit_store_host_reset;
274
271