diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-09-03 17:12:09 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-09-03 18:37:18 -0300 |
commit | c5bf204f42423f49d7ea34f14eef92780204e168 (patch) | |
tree | b6a835a5e72052fa22963f7b30fa0f1baf559bad | |
parent | dc60de338f4b2d445a24d4e36bbc994f3badb406 (diff) | |
download | op-kernel-dev-c5bf204f42423f49d7ea34f14eef92780204e168.zip op-kernel-dev-c5bf204f42423f49d7ea34f14eef92780204e168.tar.gz |
V4L/DVB (8790): saa7115: call i2c_set_clientdata only when state != NULL
Not a bug as such, but it looks really strange doing this before
checking whether the state structure could be allocated.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/saa7115.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index bcd1c8f..ad733ca 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -1489,10 +1489,9 @@ static int saa7115_probe(struct i2c_client *client, client->addr << 1, client->adapter->name); state = kzalloc(sizeof(struct saa711x_state), GFP_KERNEL); - i2c_set_clientdata(client, state); - if (state == NULL) { + if (state == NULL) return -ENOMEM; - } + i2c_set_clientdata(client, state); state->input = -1; state->output = SAA7115_IPORT_ON; state->enable = 1; |