diff options
Diffstat (limited to 'drivers/media/dvb-frontends/dvb_dummy_fe.c')
| -rw-r--r-- | drivers/media/dvb-frontends/dvb_dummy_fe.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c index dcfc902c8678..d5acc304786b 100644 --- a/drivers/media/dvb-frontends/dvb_dummy_fe.c +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c | |||
| @@ -121,16 +121,13 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void) | |||
| 121 | 121 | ||
| 122 | /* allocate memory for the internal state */ | 122 | /* allocate memory for the internal state */ |
| 123 | state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); | 123 | state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); |
| 124 | if (state == NULL) goto error; | 124 | if (!state) |
| 125 | return NULL; | ||
| 125 | 126 | ||
| 126 | /* create dvb_frontend */ | 127 | /* create dvb_frontend */ |
| 127 | memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops)); | 128 | memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops)); |
| 128 | state->frontend.demodulator_priv = state; | 129 | state->frontend.demodulator_priv = state; |
| 129 | return &state->frontend; | 130 | return &state->frontend; |
| 130 | |||
| 131 | error: | ||
| 132 | kfree(state); | ||
| 133 | return NULL; | ||
| 134 | } | 131 | } |
| 135 | 132 | ||
| 136 | static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops; | 133 | static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops; |
| @@ -141,16 +138,13 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void) | |||
| 141 | 138 | ||
| 142 | /* allocate memory for the internal state */ | 139 | /* allocate memory for the internal state */ |
| 143 | state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); | 140 | state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); |
| 144 | if (state == NULL) goto error; | 141 | if (!state) |
| 142 | return NULL; | ||
| 145 | 143 | ||
| 146 | /* create dvb_frontend */ | 144 | /* create dvb_frontend */ |
| 147 | memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops)); | 145 | memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops)); |
| 148 | state->frontend.demodulator_priv = state; | 146 | state->frontend.demodulator_priv = state; |
| 149 | return &state->frontend; | 147 | return &state->frontend; |
| 150 | |||
| 151 | error: | ||
| 152 | kfree(state); | ||
| 153 | return NULL; | ||
| 154 | } | 148 | } |
| 155 | 149 | ||
| 156 | static struct dvb_frontend_ops dvb_dummy_fe_qam_ops; | 150 | static struct dvb_frontend_ops dvb_dummy_fe_qam_ops; |
| @@ -161,16 +155,13 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void) | |||
| 161 | 155 | ||
| 162 | /* allocate memory for the internal state */ | 156 | /* allocate memory for the internal state */ |
| 163 | state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); | 157 | state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); |
| 164 | if (state == NULL) goto error; | 158 | if (!state) |
| 159 | return NULL; | ||
| 165 | 160 | ||
| 166 | /* create dvb_frontend */ | 161 | /* create dvb_frontend */ |
| 167 | memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops)); | 162 | memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops)); |
| 168 | state->frontend.demodulator_priv = state; | 163 | state->frontend.demodulator_priv = state; |
| 169 | return &state->frontend; | 164 | return &state->frontend; |
| 170 | |||
| 171 | error: | ||
| 172 | kfree(state); | ||
| 173 | return NULL; | ||
| 174 | } | 165 | } |
| 175 | 166 | ||
| 176 | static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = { | 167 | static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = { |
