Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280094
b: refs/heads/master
c: eea915b
h: refs/heads/master
v: v3
  • Loading branch information
Neil Horman authored and Greg Kroah-Hartman committed Jan 5, 2012
1 parent e5ecd79 commit 85e4693
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f257a142fc3868d69de3f996b95d7bdbc509560
refs/heads/master: eea915bb0d1358755f151eaefb8208a2d5f3e10c
14 changes: 7 additions & 7 deletions trunk/drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ static ssize_t firmware_loading_store(struct device *dev,
int loading = simple_strtol(buf, NULL, 10);
int i;

mutex_lock(&fw_lock);

if (!fw_priv->fw)
goto out;

switch (loading) {
case 1:
mutex_lock(&fw_lock);
if (!fw_priv->fw) {
mutex_unlock(&fw_lock);
break;
}
firmware_free_data(fw_priv->fw);
memset(fw_priv->fw, 0, sizeof(struct firmware));
/* If the pages are not owned by 'struct firmware' */
Expand All @@ -243,7 +243,6 @@ static ssize_t firmware_loading_store(struct device *dev,
fw_priv->page_array_size = 0;
fw_priv->nr_pages = 0;
set_bit(FW_STATUS_LOADING, &fw_priv->status);
mutex_unlock(&fw_lock);
break;
case 0:
if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) {
Expand Down Expand Up @@ -274,7 +273,8 @@ static ssize_t firmware_loading_store(struct device *dev,
fw_load_abort(fw_priv);
break;
}

out:
mutex_unlock(&fw_lock);
return count;
}

Expand Down

0 comments on commit 85e4693

Please sign in to comment.