Commit 24315c5e authored by Kristian Høgsberg's avatar Kristian Høgsberg Committed by Stefan Richter

firewire: Only set client->iso_context if allocation was successful.

This patch fixes an OOPS on cdev release for an fd where iso context
creation failed.
Signed-off-by: default avatarKristian Høgsberg <krh@redhat.com>
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 18b46179
...@@ -640,6 +640,7 @@ iso_callback(struct fw_iso_context *context, u32 cycle, ...@@ -640,6 +640,7 @@ iso_callback(struct fw_iso_context *context, u32 cycle,
static int ioctl_create_iso_context(struct client *client, void *buffer) static int ioctl_create_iso_context(struct client *client, void *buffer)
{ {
struct fw_cdev_create_iso_context *request = buffer; struct fw_cdev_create_iso_context *request = buffer;
struct fw_iso_context *context;
if (request->channel > 63) if (request->channel > 63)
return -EINVAL; return -EINVAL;
...@@ -661,15 +662,17 @@ static int ioctl_create_iso_context(struct client *client, void *buffer) ...@@ -661,15 +662,17 @@ static int ioctl_create_iso_context(struct client *client, void *buffer)
return -EINVAL; return -EINVAL;
} }
context = fw_iso_context_create(client->device->card,
request->type,
request->channel,
request->speed,
request->header_size,
iso_callback, client);
if (IS_ERR(context))
return PTR_ERR(context);
client->iso_closure = request->closure; client->iso_closure = request->closure;
client->iso_context = fw_iso_context_create(client->device->card, client->iso_context = context;
request->type,
request->channel,
request->speed,
request->header_size,
iso_callback, client);
if (IS_ERR(client->iso_context))
return PTR_ERR(client->iso_context);
/* We only support one context at this time. */ /* We only support one context at this time. */
request->handle = 0; request->handle = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment