File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -246,38 +246,38 @@ static const struct file_operations request_fops = {
246246struct media_request *
247247media_request_get_by_fd (struct media_device * mdev , int request_fd )
248248{
249- struct file * filp ;
249+ struct fd f ;
250250 struct media_request * req ;
251251
252252 if (!mdev || !mdev -> ops ||
253253 !mdev -> ops -> req_validate || !mdev -> ops -> req_queue )
254254 return ERR_PTR (- EACCES );
255255
256- filp = fget (request_fd );
257- if (!filp )
256+ f = fdget (request_fd );
257+ if (!f . file )
258258 goto err_no_req_fd ;
259259
260- if (filp -> f_op != & request_fops )
260+ if (f . file -> f_op != & request_fops )
261261 goto err_fput ;
262- req = filp -> private_data ;
262+ req = f . file -> private_data ;
263263 if (req -> mdev != mdev )
264264 goto err_fput ;
265265
266266 /*
267267 * Note: as long as someone has an open filehandle of the request,
268- * the request can never be released. The fget () above ensures that
268+ * the request can never be released. The fdget () above ensures that
269269 * even if userspace closes the request filehandle, the release()
270270 * fop won't be called, so the media_request_get() always succeeds
271271 * and there is no race condition where the request was released
272272 * before media_request_get() is called.
273273 */
274274 media_request_get (req );
275- fput ( filp );
275+ fdput ( f );
276276
277277 return req ;
278278
279279err_fput :
280- fput ( filp );
280+ fdput ( f );
281281
282282err_no_req_fd :
283283 dev_dbg (mdev -> dev , "cannot find request_fd %d\n" , request_fd );
You can’t perform that action at this time.
0 commit comments