diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-08-24 13:34:15 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2008-08-24 13:34:15 +0200 |
commit | f53b09dad8e22d19c98a9c136dcfd35dbd09428a (patch) | |
tree | 9ea23f1fd6a0920c42923739b53ba3e758a4eddc | |
parent | 55603638a502a8b7bc46a556a7b7108b71996ad6 (diff) | |
download | mediapointer-dvb-s2-f53b09dad8e22d19c98a9c136dcfd35dbd09428a.tar.gz mediapointer-dvb-s2-f53b09dad8e22d19c98a9c136dcfd35dbd09428a.tar.bz2 |
saa7115: call i2c_set_clientdata only when state != NULL
From: Hans Verkuil <hverkuil@xs4all.nl>
Not a bug as such, but it looks really strange doing this before
checking whether the state structure could be allocated.
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r-- | linux/drivers/media/video/saa7115.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/linux/drivers/media/video/saa7115.c b/linux/drivers/media/video/saa7115.c index 5488679ed..e2c68d8ca 100644 --- a/linux/drivers/media/video/saa7115.c +++ b/linux/drivers/media/video/saa7115.c @@ -1498,10 +1498,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; |